Measure Page Scrolling in Google Analytics

A Google Analytics plugin for measuring page scrolling

Earlier today I came across a Google Analytics plugin called Scroll Depth, developed by Rob Flaherty. Here’s how he describes Scroll Depth:

Scroll Depth is a small Google Analytics plugin that allows you to measure how far down the page your users are scrolling. It monitors the 25%, 50%, 75%, and 100% scroll points, sending a Google Analytics Event at each one.

You can also track when specific elements on the page are scrolled into view. On a blog, for example, you could send a Scroll Depth event whenever the user reaches the end of a post.

The plugin supports Universal Analytics, Classic Google Analytics, and Google Tag Manager.

Scroll Depth is available on GitHub and on it’s project page. Getting it setup is easy, the only two requirements are Google Analytics and jQuery.

Below is a basic setup.

<script src="jquery.scrolldepth.min.js"></script>
<script>
$(function() {
  $.scrollDepth();
});
</script>

Just be sure to include jquery.scrolldepth.min.js and the call to .scrollDepth() is made after Google Analytics has been loaded up.

There’s a number of options you can pass, too:. I especially like the elements option. It allows you to define a unique element to record scroll events for. So, if you want to track when users scroll to the footer of a post in WordPress, you could easily set that up!

$.scrollDepth({
  minHeight: 2000,
  elements: ['#comments', 'footer'],
  percentage: false,
  userTiming: false,
  pixelDepth: false
});

As stated, the only requirements are Google Analytics and jQuery. If it doesn’t seem to be working for you, ensure that Scroll Depth isn’t being loaded before your Google Analytics tracking code.

0

Well, now what?

Work with Me

I'm available for hire and always taking new clients, big and small. Got a project or an idea you'd like to discuss? Startup plan but no developer to make it happen? Just get in touch, I'd love to see if I can help you out!

Leave some Feedback

Got a question or some updated information releavant to this post? Please, leave a comment! The comments are a great way to get help, I read them all and reply to nearly every comment. Let's talk. πŸ˜€

Longren.io is proudly hosted by DigitalOcean

DigitalOcean

7 thoughts on “Measure Page Scrolling in Google Analytics

    1. I’ve been running it here, actually!

      Ever since Google revamped the Analytics UI, I’ve had a terrible time find my way around.

      I haven’t been able to find where I can find these exact events, or maybe it’s not reporting properly.

      I’ll do some troubleshooting tomorrow. πŸ™‚

      0
  1. Hey, this sounds very good but in my case it does not work. I dont know why. I think i have implemented it correct but no event was tracked πŸ™

    0
  2. Pingback: traiteur rabat

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.