spent way too long trying to track specific scroll depths without bloating the event stream. standard 25/50/75/100 triggers are fine but they're useless if you don't know which part of the page actually matters for conversion. i've been using a simple threshold check in the observer config so it only fires when someone hits a specific milestone like the footer or a lead form.
const thresholds = [25, 50, 75, 100];const observer = new IntersectionObserver((entries) => {entries.forEach(entry => {if (entry.isIntersecting) {gtag('event', 'scroll_milestone', { percent: entry.target.dataset.percent });}});}, { threshold: 1.0 });it's
way cleaner than having a dozen separate event listeners for every single div on the page. works best when you're tracking long-form landing pages where the bottom of the page is basically a different viewport entirely. does anyone else bother with custom thresholds or do you just stick to the defaults?