You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have set up custom triggers and tags to detect when scroll depth hits 10%, 25%, 50%, 75%, and 90% and we currently only fire these deliberately on any pages at a URL that contains ‘stories’.
Another (maybe simpler?) solution – I couldn’t make this work, then tried a variation whereby a history change trigger would fire a reset_scroll_depth tag which served to wipe out the gtm.scrollDepth events in the dataLayer. But that didn’t work either. First off, the history change trigger only fired once, and while it did remove the gtm.scrllDepth events, this wasn’t enough for them to be picked up on subsequent scrolls.
I also tried implementing a tag that implemented its own history change (popstate) listener (e.g. window.addEventListener(‘popstate’, () => /* reset scroll somehow */ )); but I couldn’t get that to fire at all (I have no idea why).
Search
We have set up custom triggers and tags to handle when someone has searched for something. The implementation checks for when there has been a click on the word ‘search’, rather than anything to do with the url and query string (or form input changes). As such, it doesn’t detect something as a search when e.g. you have already searched for a term in the ‘All’ tab, then click the ‘Catalogue’ tab to get those specific results (since you didn’t click ‘search’). One possible solution in this Stack Overflow post.
GA4 'enhanced measurements' have built in search support, but (for most likley for the same client-side routing reasons outlined above) it doesn't work for second and subsequent searches.
The text was updated successfully, but these errors were encountered:
Scroll
We have set up custom triggers and tags to detect when scroll depth hits 10%, 25%, 50%, 75%, and 90% and we currently only fire these deliberately on any pages at a URL that contains ‘stories’.
The triggers fire (without having an associated tag) on the non-catalogue pages, and on the first visit to a catalogue page, but they don’t for subsequent catalogue (i.e. ‘search’) pages. If we want information about scroll depth on search, we’ll need to fix this. I’ve found other people suffering with the problem. Simo Ahava mentions 'one thing that is questionable is how well this jives with a single-page app'
One possible off-the-happy-path solution
Another (maybe simpler?) solution – I couldn’t make this work, then tried a variation whereby a
history change
trigger would fire areset_scroll_depth
tag which served to wipe out thegtm.scrollDepth
events in thedataLayer
. But that didn’t work either. First off, thehistory change
trigger only fired once, and while it did remove thegtm.scrllDepth
events, this wasn’t enough for them to be picked up on subsequent scrolls.I also tried implementing a tag that implemented its own history change (
popstate
) listener (e.g.window.addEventListener(‘popstate’, () => /* reset scroll somehow */ ));
but I couldn’t get that to fire at all (I have no idea why).Search
We have set up custom triggers and tags to handle when someone has searched for something. The implementation checks for when there has been a click on the word ‘search’, rather than anything to do with the url and query string (or form input changes). As such, it doesn’t detect something as a search when e.g. you have already searched for a term in the ‘All’ tab, then click the ‘Catalogue’ tab to get those specific results (since you didn’t click ‘search’). One possible solution in this Stack Overflow post.
GA4 'enhanced measurements' have built in search support, but (for most likley for the same client-side routing reasons outlined above) it doesn't work for second and subsequent searches.
The text was updated successfully, but these errors were encountered: