How to Track Engaged Time in Google Analytics

Find out how much time users spend actively doing stuff on your site

Rob Flaherty
Google Analytics
Published in
3 min readJun 26, 2014


Lately there’s been a surge of interest in time-based metrics focused on the amount of time users spend actively engaged during a session. Because standard analytics solutions like Omniture and Google Analytics don’t provide this data out of the box, to track these metrics you generally need a specialized analytics tool, something like Chartbeat for example.

But it’s actually possible to get these metrics using Google Analytics. Here’s how.

First, get the Riveted plugin, which is just a small piece of JavaScript that you add to your site. It’s available as plain JavaScript or a WordPress plugin (the following instructions assume you’re using the plain JavaScript implementation).

More information about what the plugin does can be found on the Riveted project page but basically it listens for user activity signals like scrolling, clicking, using the keyboard, and page visibility to determine whether the user is an active or idle state.

Next, after your Google Analytics tracking code, load the script and call the riveted.init() function, like this:

If you’re happy with the default settings, that’s it—you’re done!


The default settings mean:

  1. Your bounce rate will not be affected.
  2. A user will be considered idle after 30 seconds of inactivity.
  3. An event will be sent to Google Analytics every 5 seconds updating the amount of active engaged time.

These settings are easy to adjust. For information on using these options, see the plugin options details on the Riveted project page.

Note: if you’re concerned about sending too many GA events, it may be wise to change the Report Interval to 10 seconds.

Advanced Stuff

The plugin provides a few methods for programmatically starting and stopping the timer. An example use case would be if you wanted to keep the Riveted timer going…