These days most sites have long pages, which means users must scroll down to view the complete page.
You always wonder if people are scrolling down or not. Google Tag Manager can help with this too.
Google Tag Manager has built-in variables to track users' scroll behavior. You can post these variables to an analytics tool such as Google Analytics.
Let’s look at how to enable such tracking.
Configuring the Scroll variables
Click on variables and the “Configure” button in the Built-in variables section.
There are a few built-in variables that provide information about the users' scroll behavior. These variables are
- Scroll Depth Threshold – measures the percentage of the scroll.
- Scroll Depth Units - measures scroll depth in pixels
- Scroll Direction – measures the direction of scroll, horizontal or vertical.
Select all these variables so that they can be available for you to use them in your tags and triggers.
Once done, click on X to get out, and now you have these three variables available to you.
Configuring the Scroll Trigger
Follow these steps to create a new trigger
- 1. Click on New trigger and pick “Scroll Depth” as trigger type.
- 2. In the next window, select if you want to track Vertical or Horizontal scroll. I selected vertical as the pages on my site are long, and the width fits the screen, so there is no horizontal scroll.
- 3. Next, select if you want to measure scrolling as percentages or pixels. I suggest measuring as percentages as pixels might be hard to measure and understand.
- 4. Finally, enter the values of the marks you would like to track. I want to see track the percentage of traffic that scroll 25%, 50%, 75%, and 100%, so I enter these values separated by comma (no percentage sign.)
- 5. Leave everything as it is.
Your final configuration will be as shown in the figure below.
Figure: Scroll Tracking Trigger
Give the trigger a name and save it.
Keep in mind that all the percentages that users scroll through will be triggered as the user is scrolling through. So if a user scrolls to 100%, all the for marks, 25%, 50%, 75%, and 100% will be triggered.
Configuring the Scroll Tag
We will track scroll depth and scroll direction as an event in Google Analytics.
I will use the following configurations
Category: Static value as Scroll.
Action: Variable that contains Scroll Depth and then added a % sign after it
Label: Variable that contains scroll direction.
Here is the configuration of this tag.
Figure: Scroll as Event in Google Analytics
Save the Tag and attach the Trigger that was created for scrolling.
Be sure to preview the tag, and ensure that it is firing the right values.
Figure: Scroll depth tracking in preview mode
Figure: Scroll depth tracking in Google Analytics real-time
Want to learn Google Tag Manager. Here are few options: