snowplow / snowplow/snowplow-javascript-tracker
Update page ping functionality to make it possible to separately set ping resolution and timeout interval
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 590
- Forks
- 232
- Avg merge
- 2h 22m
- Merged PRs (30d)
- 3
Description
Suggested by @UriGrod
In the current implementation, a page ping fires every X seconds. A user is considered active if there's been activity in the last ping period, in which case a ping fires. If not, no ping fires.
A byproduct of this approach is that it results in problems for users who want to to use a very high ping resolution (i.e. distinguish users who are active on the site for 53 seconds vs 58 seconds for example). By setting ping periods to be very short, it forces the user to be active over that very short period in order for the ping to fire. This means that it may report a user as inactive, when in fact, the user is still reading content, but hasn't e.g. moved a mouse or performed another activity to trigger the ping. As a result, we recommend that users keep ping periods relatively long (e.g. 10 seconds plus).
An alternative approach is to set two periods:
- A ping period, that determines the resolution of the measure
- A timeout period, which determines how long a period of inactivity needs to occur before a ping fails to fire
This is the approach taken by Riveted. See here for more details.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the current page ping implementation and reading how its activity window and firing interval are configured. Define separate ping-resolution and inactivity-timeout settings, then verify that high-resolution measurement does not classify users as inactive solely because they have not interacted during a short ping period.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- analytics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100