Scroll tracking
Another useful user interaction to track is scrolling. We can use the scroll event for this. This event fires as a user scrolls through a page. This could be useful in article or blog style pages to determine whether users are reading all the way through your content.
The scrollSpec object allows you to specify through what percentage of the page the user must scroll before the event will fire. Vertical and horizontal percentages are specified in the verticalBoundaries and horizontalBoundaries properties respectively. In the following configuration (/ch10/ga-scroll.html), the scroll trigger will be fired when the page is scrolled vertically to 25 percent, 50 percent, 75 percent, and 100 percent. Boundaries are rounded to the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access