Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Web Vitals force page hide #953

Merged
merged 1 commit into from
Jul 11, 2023
Merged

Web Vitals force page hide #953

merged 1 commit into from
Jul 11, 2023

Conversation

inancgumus
Copy link
Member

@inancgumus inancgumus commented Jun 23, 2023

After reverting #949 in #964, which main purpose was to improve Web Vitals metrics consistent reporting, we need to provide an implementation that would achieve this consistency without the drawbacks introduced in #949 and explained in #964.
For that purpose this modification to force pagehide event has proven to be the better fix so far as commented in #960 (comment) and also similar to recommendations given in the Web Vitals library readme:

Note that some of these metrics will not report until the user has interacted with the page, switched tabs, or the page starts to unload. If you don't see the values logged to the console immediately, try reloading the page (with preserve log enabled) or switching tabs and then switching back.

Related #960.

@inancgumus inancgumus changed the base branch from main to fix/914-web-vital-test-bug June 23, 2023 17:37
Base automatically changed from fix/914-web-vital-test-bug to main June 26, 2023 10:11
This brings back the hack we removed from PR #949. I've also added a
test for it. When we remove the hack, the test fails, otherwise passes.
@ka3de ka3de force-pushed the fix/914-web-vital-force-page-hide branch from 31ee820 to 1ace782 Compare July 11, 2023 10:19
@ka3de ka3de self-assigned this Jul 11, 2023
@ka3de ka3de requested a review from ankur22 July 11, 2023 10:26
Copy link
Collaborator

@ankur22 ankur22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@ka3de ka3de merged commit a8ebe8c into main Jul 11, 2023
@ka3de ka3de deleted the fix/914-web-vital-force-page-hide branch July 11, 2023 10:45
@inancgumus inancgumus linked an issue Jul 24, 2023 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Web Vitals metrics are not consistently reported
3 participants