feat: added analytics

pull/1/head
Antonio De Lucreziis 2 years ago
parent 0955f18e04
commit a236c662af

@ -32,9 +32,16 @@ export const App = ({ url }: { url?: string }) => {
// during server side rendering don't prepend the BASE_URL // during server side rendering don't prepend the BASE_URL
const pbu = useContext(ServerContext) ? (s: string) => s : prependBaseUrl const pbu = useContext(ServerContext) ? (s: string) => s : prependBaseUrl
const handleRouteChange = () => {
// @ts-ignore
window.goatcounter.count({
path: location.pathname + location.search + location.hash,
})
}
return ( return (
<UserProvider> <UserProvider>
<Router url={url}> <Router url={url} onChange={handleRouteChange}>
<HomePage <HomePage
// @ts-ignore // @ts-ignore
path={pbu('/')} path={pbu('/')}

@ -19,6 +19,8 @@
<link rel="stylesheet" href="/node_modules/katex/dist/katex.css" /> <link rel="stylesheet" href="/node_modules/katex/dist/katex.css" />
<link rel="stylesheet" href="/client/styles/main.scss" /> <link rel="stylesheet" href="/client/styles/main.scss" />
<script data-goatcounter="https://analytics.phc.dm.unipi.it/count" async src="//analytics.phc.dm.unipi.it/count.js"></script>
<!-- INJECT META TAGS --> <!-- INJECT META TAGS -->
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
</head> </head>

Loading…
Cancel
Save