This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
Fix extra long pageVisibilityTracker visible time reporting #177
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Version 2.1.0 introduced a subtle bug where, if a user loaded a page and then left before the visibility threshold was met, if they returned to the site at a later date, the visibility time reported was the time since the initial visit.
This PR adds more accurate session expiry checking to ensure the reported visible times are within the current session only.
Note: If this bug is affecting the data in your reports, the best way to get around it is to create a segment that excludes any sessions containing visible metrics (per hit) longer than one day (or the session timeout amount, whichever works best).