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
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Trending

0
Would love your thoughts, please comment.x
()
x