Adding page
to reportWebVitals
payload
#26586
Unanswered
jackjdleslie
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Context
Collecting web vitals through default Next.js Analytics allows you to view metrics per page, however the custom
reportWebVitals
payload doesn't contain the data forpage
.Solution
The way that it's done currently via Next.js Analytics is by reading
window.__NEXT_DATA__.page
, so we can use this same mechanism withreportWebVitals
.Implementation
Issue: #23457
Pull Request: #23458
Beta Was this translation helpful? Give feedback.
All reactions