Connect with us

Web Development

How to Track Page Scroll Depth in GA4 (no tagging)

Published

, on

Just add this code to your GA4 script:

 window.addEventListener('scroll', function() {
 if (window.scrollY > (document.documentElement.scrollHeight - window.innerHeight) / 2) {
 gtag('event', 'scroll', {
 'event_category': 'Scroll',
 'event_action': 'Scroll 50%',
 'event_label': '
'
 });
 }

Here is live code on my website:

GA4 Report View

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Trending