snowplow-javascript-tracker
snowplow-javascript-tracker copied to clipboard
Add feature to explicitly handle 'stray' page pings
Is your feature request related to a problem? Please describe.
If a user leaves a tab dormant for a long time then returns, they can trigger page ping events which share a page view ID with the original page view, but have a different session id (because the session timeout expired).
Now we may not want to disregard these - the user might continue to browse with genuine activity from there, in which case activity on the reactivated tab would currently be disregarded (as it doesn't have a page view).
At modeling stage this poses a bit of a challenge.
Describe the solution you'd like
I can think of two approaches -
- some option to trigger a new page view when a tab is reactivated (for example if the session ID changes, trigger a page view perhaps).
- A new page-view-like event which specifically denotes reactivation of a tab.
Both solutions should deal with the page ping timer somehow to ensure consistent behaviour.
ZD ticket reference 26783 for an example (closed source) of when this comes into focus
Some discussion: https://discourse.snowplowanalytics.com/t/page-id-crosses-sessions-and-over-inflates-time/5410/3
Ping aggregation deepens the requirement for a feature as the unload event must be triggered to receive the aggregate pings, these can be aggregated over many sessions. Therefore no 'stray pings' occur rather a 'stray event'.
I think possibly 2 event types like page_view_end (session close) and page_view_resume (new ping/event on same page) would be ideal.