-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Hey there,
I added the <SpeedInsight /> component to a next.js app and noticed most visits weren't appearing on the dashboard.
Dissecting the script that sends this metrics to vercel I noticed it is geared towards sending this data upon navigations/page visibility changes:
addEventListener("visibilitychange",c)addEventListener("pagehide",c)addEventListener("popstate",c)
let e=history.pushState.bind(history);
history.pushState = function(...t){
e(...t);
try {
c()
} catch(n) {
}
}the problem we are facing is that the application is a single page checkout, state is mostly client-side and the "happy path" doesn't include any client-side navigation. I believe adding the same listener to requestIdleCallback makes sense here.
(ensures the data is sent during idle periods, so won't disrupt the user, use CPU during busy periods or congest a limited network upload while the page is using them)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels