Configuring scroll depth tracking in Google Tag Manager (GTM) allows you to track how far users scroll down on a page. This is helpful for understanding user engagement and which parts of your content are the most engaging. Here’s how to set it up:
Step 1: Enable Built-in Variables
- Log in to your GTM account and select your container.
- Go to Variables from the left-hand menu.
- Click Configure under Built-in Variables.
- Ensure that Scroll Depth Threshold, Scroll Depth Units, and Scroll Direction are checked. These variables help capture data about user scrolling.
Step 2: Create a Scroll Depth Trigger
- Navigate to Triggers in the GTM interface.
- Click New to create a new trigger and name it (e.g., “Scroll Depth Trigger”).
- Click on Trigger Configuration and select Scroll Depth under User Engagement.
- Configure the trigger settings:
- Vertical Scroll Depths: Input the percentages you want to track (e.g., 25%, 50%, 75%, 100%).
- Horizontal Scroll Depths: Leave unchecked if you only want to track vertical scrolling.
- Choose Scroll Depth Units:
- Percentages: This is typically used to understand how far down the page users scroll.
- Under This trigger fires on, choose All Pages if you want it to track on all pages, or specify particular pages as needed.
- Save the trigger.
Step 3: Create a Tag to Track Scroll Events
- Go to Tags in the GTM interface.
- Click New to create a new tag and name it (e.g., “Scroll Depth Tag”).
- Click on Tag Configuration and choose either:
- Google Analytics: GA4 Event (for GA4 users)
- Universal Analytics (for Universal Analytics users)
For GA4:
- Event Name: Set it to something like
scroll_depth
. - Event Parameters: Add parameters for tracking details:
- scroll_depth_threshold:
{{Scroll Depth Threshold}}
- scroll_depth_units:
{{Scroll Depth Units}}
- scroll_direction:
{{Scroll Direction}}
- scroll_depth_threshold:
- Select your GA4 Configuration Tag for the tag to send data to your GA4 property.
For Universal Analytics:
- Track Type: Select Event.
- Set Category as “Scroll Depth,” Action as
{{Scroll Depth Threshold}}
, and Label as{{Page Path}}
or{{Page URL}}
for context. - Choose your Google Analytics Settings Variable.
- Under Triggering, choose the Scroll Depth Trigger you created earlier.
- Save the tag.
Step 4: Test Your Setup
- Click Preview in GTM to enter the debug mode.
- Open your website in a new tab where the GTM preview mode is enabled.
- Scroll down the page and observe the GTM debug panel to check if the scroll depth tag fires at the configured points (e.g., 25%, 50%, 75%, 100%).
- Ensure that the events are being tracked in your analytics platform (e.g., Google Analytics Real-time reports).
Step 5: Publish Your Container
- Once everything is confirmed to work correctly in preview mode, return to the GTM interface.
- Click Submit and publish your container.
- Provide a version name and description for your reference.
Step 6: Verify Data in Google Analytics
- For GA4:
- Navigate to Reports > Engagement > Events.
- Look for your event name (e.g.,
scroll_depth
) and verify that data is coming through.
- For Universal Analytics:
- Go to Behavior > Events > Overview.
- Check for the Event Category “Scroll Depth” and review the data.
Tips for Enhancing Scroll Depth Tracking
- Refine Triggers: Customize the scroll depth percentages to align with content length and key engagement points.
- Combine with Other Triggers: Use scroll depth tracking alongside other triggers to create a more comprehensive picture of user engagement (e.g., time-on-page tracking).
- Set Goals in Analytics: Create goals in Google Analytics based on scroll depth data to track how user engagement correlates with your conversion objectives.
- Monitor Event Limits: If you’re tracking scroll depth for a high-traffic site, ensure that event tracking doesn’t exceed the limits of your analytics platform.
By following these steps, you’ll be able to track scroll depth in GTM, giving you insights into how users interact with your content and helping inform your content strategy and user experience improvements.