-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Description
Looking at the source, avg_time_on_site is calculated from time_to_next_event, filtered to exclude values greater than 30 minutes or NULL. This means the last event in a session (where time_to_next_event is NULL) is excluded from the average.
The tracker script also doesn't seem to send any outgoing events (sendBeacon, visibilitychange, pagehide, etc.), so we were wondering: is the time spent on the last visited page intentionally not considered in the avg time calculation?
We tested sending a custom event via the API:
POST /api/event
{ "name": "heartbeat", "entity_id": "...", "url": "..." }This gets recorded and correctly populates time_to_next_event on the previous event. We could use setInterval with the exported event() function as a workaround.
Two questions:
- Is there a recommended way to capture time on the last page of a session?
- Do custom event names like
"heartbeat"affect the hits count in the dashboard, or are only"pageview"events counted?
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels