The inimitable Simo Ahava recently posted an article named Fire GTM Tag Upon Scroll Depth And Time Spent, in which he explains both why and how to fire tracking after visitors have either lingered on or scrolled to a certain depth on pages.
With his permission, I’ll show you how to do the same with Launch, by Adobe.
The idea is to measure how the content on your web site is being consumed, read. A lot of people use metrics like “Time on Site” or “Time on Page” or “Time Spent” or whatever your Solutions calls it to figure this out, or rather to approximate it.
The huge problem with that is that you can’t actually measure whether a visitor is really looking at the page while it is open. For all we know, they could have left the room!
If you’re a media site, or if your site has content that is considered important (banks have a lot of that), then you need to know whether your content people write the right stuff.
This time, Simo suggests combining time and scrolling.
If a visitor scrolls a certain way, and if they linger for more than a certain time, do something.
The novelty is to combine those two conditions in a single Rule, to use two different parameters and trigger one action.
You might remember that I did something similar with DTM some time ago (see Delayed Page Load Tracking with DTM), but now we have Launch. And it’s easy-peasy with Launch.
Just like GTM, Launch treats multiple Events in a Rule as “OR”, meaning any of the two Events would trigger the Rule.
Simo gets around that by making sure the triggers each take into account whether the other has already fired or not. We can do the same thing in a bunch of different ways in Launch.
One way would be to do it like in the “delayed page load tracking” article mentioned above, using a “Custom Event” Event and a single Rule. A variation of that could be to use a “Custom Code” Event.
Another way would use three Rules. The first would trigger on time, the second on scroll depth, and both would call the third, actual, Rule, which would have a condition “both have fired”, so to speak.
The proper way of doing this in Launch, you ask?
Well, obviously, we build an Extension!
The Extension will provide a single Event Type, which encapsulates the whole thing, and which has four configurable settings:
- Threshold of time spent on page,
- threshold for scroll depth in %,
- a toggle which can be set to “fire just once per page” or “fire every time this happens”, and
- a delay time for attaching the scroll listener, in case the page builds dynamically.
In order to complete the Make an Extension mini series, I’ll write about how to test an Extension in the sandbox (there have been changes), how to test it on the integration environment, and how to publish it, when it is done. done
For now, all you need to do is find my Extension in the Catalogue, add it to your Property, then use it in your Rule.
Ah, so simple!
If you want, you can see the sources on github, of course.
It was great fun writing this little Extension!
So thank you, Simo, for pushing me to dig deeper into this topic!
The whole thing is possible with DTM, too, but given that we now have an official end of life announcement, I shall ignore DTM completely from now on.
One flaw in my Extension is that it is imho overly specific. I may or may not work on an alternative Extension that provides all sorts of “engagement”-related Events…