fix fathom logging pageviews as notes/[slug]

This commit is contained in:
2022-02-13 11:20:46 -05:00
parent 4580e42fdc
commit 76c2699b32
+4 -2
View File
@@ -48,10 +48,12 @@ const App = ({ Component, pageProps }: Props) => {
Fathom.load(config.fathomSiteId, { Fathom.load(config.fathomSiteId, {
// don't track branch/deploy previews and localhost // don't track branch/deploy previews and localhost
includedDomains: [config.siteDomain], includedDomains: [config.siteDomain],
// we trigger pageview sending manually below, don't also do it on script load
auto: false,
}); });
const onRouteChangeComplete = () => { const onRouteChangeComplete = (url: string) => {
Fathom.trackPageview(); Fathom.trackPageview({ url });
}; };
// needs to be triggered manually on link clicks (the page doesn't actually change) // needs to be triggered manually on link clicks (the page doesn't actually change)