Help setting up Plausible analytics
i tried a lot of variations of setting up the script including using head() scripts array, they all seem to load the script and i can use plausible function in the browser console, this is the latest one i tried (directly in <head>):
this doesn't work, neither for first page load nor any subsequent client navigations, even when i add this in router.tsx
still does not work in client navigations, even though i see the console logs, no network requests, plausible dashboard still says 0 pageviews, executing this in browser console does not work either
these are the versions i am working with in package.json:
any help with this is greatly appreciated
5 Replies
flat-fuchsia•2mo ago
executing this in browser console does not work eitherthis contradicts
i can use plausible function in the browser console,
flat-fuchsia•2mo ago
this page makes it sound like it should "just work" ™ ?
https://plausible.io/docs/spa-support
Single-page application support | Plausible docs
Plausible Analytics integrates automatically with modern pushState based frontend routers. If you're running a single-page application
correct-apricotOP•2mo ago
thanks for replying, what i meant with
i can use plausible function in the browser console,is that i can see a "plausible" function on the global window object with
typeof window.plausible === "function", so script is definitely loaded, it's just that calling it with appropriate args still does not register a pageview or log a network call in the network tabflat-fuchsia•2mo ago
so what does your script do that is setting the plausible function on window?
correct-apricotOP•2mo ago
nevermind it's working now, browser extensions were blocking the requests, i didn't think they would cause a problem since plausible is self-hosted on our own subdomain, thanks for taking the time