How to configure scroll tracking to measure user engagement in Google Tag Manager

Author:

Scroll tracking is a powerful way to measure user engagement on your website by capturing how far users scroll down a page. This data helps you understand how much content visitors are consuming, and it can be an excellent indicator of content quality and user interest. By configuring scroll tracking in Google Tag Manager (GTM), you can track how far down a page users scroll and trigger tags accordingly, such as sending data to Google Analytics for analysis.

This guide will walk you through the steps to set up scroll tracking in Google Tag Manager.

Benefits of Scroll Tracking

  • Measure Content Engagement: Helps you understand how engaging your content is by showing whether users are scrolling past key sections.
  • Optimize User Experience: Allows you to identify areas where users drop off or where content engagement peaks.
  • Track Key Page Milestones: Useful for tracking when users interact with important page sections like calls to action, product descriptions, or blog posts.
  • Conversion Insights: By tracking how far users scroll, you can associate scroll depth with conversion rates to see how engagement impacts your website goals.

Steps to Configure Scroll Tracking in Google Tag Manager

Step 1: Create a Trigger for Scroll Depth

The first step is to create a trigger in GTM that will fire whenever a user scrolls to a certain point on the page. Google Tag Manager has a built-in Scroll Depth Trigger, which makes this process simple.

  1. Log in to Google Tag Manager:
  2. Create a New Trigger:
    • From the GTM dashboard, go to the Triggers section and click New.
    • Choose Scroll Depth as the trigger type.
    • Name your trigger (e.g., “Scroll Depth Trigger”).
  3. Configure Scroll Depth Trigger:
    • In the Scroll Depth settings, you’ll see two options: Vertical Scroll Depths and Horizontal Scroll Depths.
    • Vertical Scroll Depths is what we’re primarily interested in for measuring engagement, as it tracks how far down the page users scroll.
    • Select one or more of the following options for the vertical scroll depths:
      • Percentage: Set percentages like 25%, 50%, 75%, 100%. This will track when a user scrolls past 25%, 50%, 75%, or 100% of the page.
      • Pixels: Alternatively, you can specify pixel values to measure scroll depth in terms of page length (e.g., 1000px, 2000px).
    • For example, setting up a trigger to fire at 25%, 50%, 75%, and 100% would allow you to track at four different engagement levels.
    • Ensure the option “This trigger fires on All Pages” is selected if you want to track scroll depth across your entire site.
  4. Save the Trigger:
    • After setting up your scroll depths, click Save to store the trigger.

Step 2: Create a Tag to Send Scroll Data to Google Analytics

Next, you’ll need to create a tag to send the scroll data to Google Analytics. This can be a Google Analytics – Universal Analytics Tag or a Google Analytics 4 Event Tag, depending on which version of GA you use.

For Google Analytics Universal Analytics (GA3):
  1. Create a New Tag:
    • Go to the Tags section in GTM and click New to create a new tag.
    • Choose Tag Type: Google Analytics: Universal Analytics.
  2. Configure the Tag:
    • Set the Track Type to Event.
    • Fill out the Category, Action, and Label fields. For scroll tracking, these can be dynamic so that they correspond to the scroll depth.
      • Category: “Scroll Tracking”
      • Action: “Scroll Depth”
      • Label: You can use variables like {{Scroll Depth Threshold}} to dynamically insert the scroll depth value.
      • Value: Optionally, you can set a value, such as the percentage of scroll depth.
    • Under the Google Analytics Settings, choose your existing Google Analytics variable or input your Tracking ID manually.
  3. Set the Trigger for the Tag:
    • Choose the Scroll Depth Trigger that you created in Step 1. This will link your tag to the scroll tracking trigger.
  4. Save and Test:
    • Save the tag and use GTM’s Preview mode to test if the tag fires correctly on the page and sends data to Google Analytics when users scroll through the page.
For Google Analytics 4 (GA4):
  1. Create a New Tag:
    • In the Tags section, click New and choose Google Analytics: GA4 Event.
  2. Configure the Tag:
    • For Configuration Tag, select your existing GA4 configuration tag or enter the Measurement ID manually.
    • Set the Event Name (e.g., “scroll_depth”).
    • Add event parameters:
      • scroll_depth_threshold: Use the GTM variable {{Scroll Depth Threshold}} to dynamically insert the scroll depth value.
      • Optionally, you can add parameters for page_url or scroll_percentage.
  3. Set the Trigger for the Tag:
    • Set the trigger to the Scroll Depth Trigger created earlier.
  4. Save and Test:
    • Save the tag and test it using the GTM Preview mode to confirm that data is sent correctly to Google Analytics 4.

Step 3: Test and Debug the Implementation

After setting up the trigger and tag, it’s time to test your scroll tracking implementation.

  1. Preview Mode:
    • In Google Tag Manager, click Preview to enable preview mode and test the tag firing on your site.
    • Open your site in a new tab. Scroll down the page and check the GTM Preview panel to see if the tags are firing correctly.
  2. Check Google Analytics:
    • If you are using Google Analytics Universal, go to Real-Time > Events and look for your scroll tracking events.
    • For GA4, check Events under Engagement in the Real-Time or Events section to ensure the scroll depth events are coming through.
  3. Use GTM’s Debugger:
    • GTM’s Tag Assistant can help debug whether the tags are firing at the appropriate scroll thresholds and whether the data is correctly recorded.

Step 4: Publish the Container

Once you’ve confirmed that your scroll tracking setup is working correctly, publish the container to make the changes live on your website.

  • Go to the Versions section in GTM and click Submit to publish the changes.
  • Ensure to include a description of the changes (e.g., “Added scroll tracking for engagement”).

Step 5: Analyzing Scroll Tracking Data in Google Analytics

After your scroll tracking is live and data starts coming through, you can use Google Analytics to analyze user engagement.

  1. Google Analytics Universal Analytics (GA3):
    • Go to Behavior > Events > Overview and look for your scroll tracking events.
    • You will see the scroll events categorized by the Category and Action you set (e.g., “Scroll Tracking” and “Scroll Depth”).
  2. Google Analytics 4:
    • Go to Events > All Events and you will see the scroll depth events you’ve set up (e.g., “scroll_depth”).
    • You can also create custom reports or use Exploration to further analyze the scroll depth data.

Conclusion

Setting up scroll tracking in Google Tag Manager is a straightforward process that involves creating a scroll depth trigger and a corresponding tag to send the data to Google Analytics. By configuring this, you can track user engagement, measure how far users are scrolling down on your pages, and gain insights into content performance. Whether you’re using Google Analytics Universal Analytics or GA4, scroll tracking is a valuable metric to understand how users interact with your content, which can inform content optimization and overall user experience strategies.