GTM with Infinite Scroll
-
Using the plugin with GTM and GA4 works 100% perfectly. All clicks are tracked and the data is collected and sent to GTM > GA4.
My issue pops up when I’m using the code on a Theme with Infinite Scroll. The way the theme works is, the landing page is a unique URL and as the user scrolls down, when they reach the bottom of the post, the URL changes in the browser and the new article pops up. It’s seamless and looks great for the end user.
The first page shows up great and all the accurate data is in the Data Layer. However, as the user scrolls down and hits the next article via Infinite Scroll, the URL changes and a page_view event triggers however the Data Layer info (Values) sent to GA4 are from the original post. So, postID, pagePostAuthor, pagePostDate, etc… it’s all from the original post.
Is there anyway for the plugin to grab the correct Values for Infinite Scroll pages as the user scrolls through them? I tried the GTM Visibility Trigger Event, it fires as expected and sends data however, again, all the Values added to the Data Layer are from the original post, not the new post.
The topic ‘GTM with Infinite Scroll’ is closed to new replies.