// Tracks when user scrolls 50% and 90% of page document.addEventListener('scroll', function() { const scrollPercent = (window.scrollY / (document.body.scrollHeight - window.innerHeight)) * 100; if (scrollPercent >= 50 && !window._ga4Scroll50) { gtag('event', 'scroll_depth', { percent: 50 }); window._ga4Scroll50 = true; } if (scrollPercent >= 90 && !window._ga4Scroll90) { gtag('event', 'scroll_depth', { percent: 90 }); window._ga4Scroll90 = true; } });

sec