1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-10-28 20:55:47 -04:00

fix fathom logging pageviews as notes/[slug]

This commit is contained in:
2022-02-13 11:20:46 -05:00
parent 4580e42fdc
commit 76c2699b32

View File

@@ -48,10 +48,12 @@ const App = ({ Component, pageProps }: Props) => {
Fathom.load(config.fathomSiteId, {
// don't track branch/deploy previews and localhost
includedDomains: [config.siteDomain],
// we trigger pageview sending manually below, don't also do it on script load
auto: false,
});
const onRouteChangeComplete = () => {
Fathom.trackPageview();
const onRouteChangeComplete = (url: string) => {
Fathom.trackPageview({ url });
};
// needs to be triggered manually on link clicks (the page doesn't actually change)