Don't have one? Create one ↗
← All courses

Lesson 7 of 15

Scroll Depth Tracking

① Connect your GTM container

Paste your container ID to load it into this page. It only ever runs here.

Advanced: use a specific environment

How far down the page do people actually read? GTM's Scroll Depth trigger answers that, firing at thresholds you set, typically 25, 50, 75 and 100 percent of the page height.

You'll turn on the Scroll Depth variables, build one trigger for all four thresholds, and watch each fire once as you scroll this page to the bottom.

Goal

Fire a tag at 25, 50, 75 and 100% page depth, using the Scroll Depth trigger.

Build it in GTM

  1. Enable the Scroll Depth variables

    1. Go to Variables in the left sidebar and click Configure at the top of the Built-In Variables section.
    2. Switch on Scroll Depth Threshold (and Scroll Depth Units / Scroll Direction if you want them on your tag).
  2. Create the trigger

    1. Go to Triggers in the left sidebar and click New.
    2. Click the trigger-type box and choose Scroll Depth.
    3. Tick Vertical Scroll Depths, choose Percentages, and enter 25,50,75,100.
    4. Name it Scroll - Vertical and Save.
  3. Tag: Custom HTML - Test

    1. Go to Tags → New and choose Custom HTML.
    2. Paste <script></script> (fires but does nothing) and name it Custom HTML - Test.
    3. Under Triggering, add Scroll - Vertical, then Save. On a real tag you'd send Scroll Depth Threshold as a parameter so you know which threshold fired.

Debug in Tag Assistant

Copy this lesson's live URL and paste it into GTM Preview, that is the page Tag Assistant connects to. It has the clickable elements, so this page stays clean for reading.

  1. In your GTM, click Preview.
  2. Paste the live URL above and click Connect.
  3. Interact with the live page and watch your tag fire in Tag Assistant.

What you should expect to see

As you scroll, the timeline adds a Scroll Depth event at 25, 50, 75 and 100 percent. Each one fires your tag, and the Scroll Depth Threshold variable shows the percentage.

Verify your container

Built it? Export your container, Admin → Export Container, choose your workspace, then drop the JSON here to check it against this lesson.

Drop your container .json here

or browse · checked in your browser, nothing is uploaded

0 of 15 lessons complete