-
Notifications
You must be signed in to change notification settings - Fork 34
Page changes are no longer tracked in SvelteKit 2 #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Experiencing the same |
It has (most probably) nothing to do with SvelteKit, I am using plain Next.js (latest version) and unfortunately I am experiencing the same issues as described by @mattpilott. It will only recognise the route of the initial page load OR on a full refresh. I am using the |
…nkeypatch it Some other libraries might hook into `history.replaceState/pushState` to do additional work. This no longer works since the introduction of shallow routing because we're stashing away the original history methods. This PR adjusts the DEV time check logic so that this is no longer necessary. Related to vercel/analytics#121
Hey @mattpilott This should be resolved by the SvelteKit patch you see linked above. @hchris21 |
Hey @tobiaslins, thanks for the reply. Here is the domain: https://www.hornxengineering.dev |
@hchris21 which Next.js version are you on? |
@tobiaslins, on my latest build I am using Next.js <html lang="en">
<body>
<main>
<Navbar /> // this is the component with the Links
{children}
</main>
<Analytics />
</body>
</html> I have also tried it out with the |
Hey @tobiaslins, I have updated the dependencies and now it is showing the page views on my non-root pages as well. (tested it with different users on different devices) I assume it has to do with the fact that the |
Will close this here! feel free to reopen if there are other issues |
Using @vercel/analytics with SvelteKit v2 only registers the initial page load and ignores all subsequent requests.
Followed the guide here: https://vercel.com/docs/analytics/quickstart
Implemented the inject function in layout.js, tried inside and outside the load function plus tried it in the layout.svelte file and all give the same result. The only way to get a navigation to register beyond the initial page load is to do a page reload
This means web analytics with SvelteKit 2 is currently of limited use and is largely broken
The text was updated successfully, but these errors were encountered: