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.
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…
Here’s an approach you can start with, using page pings that start after 5 seconds and go every 5 seconds:
app_id,
page_urlpath,
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
FROM atomic.events
GROUP BY
app_id,
page_urlpath
ORDER BY page_views DESC