The Tracker uses event handlers to determine whether the user is browsing actively. You can see a list of the listeners here.
snowplow_name_here('enableActivityTracking', 30, 10);
If the Tracker is configured this way, it will first wait for 30 seconds before sending any page pings. After that, every 10 seconds it will decide whether to fire a page ping event based on whether any of those activity handlers have been triggered.
Thanks for the description Fred.
Now how do you analyse the results? It’s gonna be a big gnarly query to count through all of those and work out an aggregate Time Spent metric on a particular page…
I’ll be posting a recipe soon on how to calculate time spent using page pings. Stay tuned!
@christophe didi you get the time spent done?
Here’s an approach you can start with, using page pings that start after 5 seconds and go every 5 seconds:
COUNT(event = 'page_view' OR NULL) AS page_views,
(COUNT(event = 'page_view' OR NULL) * 5) + (COUNT(event = 'page_ping' OR NULL) * 5) AS time_spent,
(COUNT(event = 'page_view' OR NULL) * 5) + (COUNT(event = 'page_ping' OR NULL) * 5) / NULLIF(COUNT(event = 'page_view' OR NULL),0) AS apd
ORDER BY page_views DESC