How can I integrate Goatcounter in SvelteKit SSR with hydration? "window.addEventListener('hashchange'," seems not to work #10303
Unanswered
stephane-klein
asked this question in
Q&A
Replies: 1 comment
-
Listening to the I haven't tried it myself, but maybe you can use <script>
import { afterNavigate } from '$app/navigation';
afterNavigate(({ to }) => {
const url = to?.url;
if (url) {
window.goatcounter.count({
path: url.pathname + url.search + url.hash
})
}
})
</script>
<slot /> |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Hello,
I try to configure Add GoatCounter to a SPA in my SvelteKit project, here.
I don't see
"ici1"
in my browser console when I change pages 🤔.Do you have any ideas for implementing this Goatcounter integration in my SvelteKit project?
Best regards,
Stéphane
Beta Was this translation helpful? Give feedback.
All reactions