feat: added analytics
This commit is contained in:
+8
-1
@@ -32,9 +32,16 @@ export const App = ({ url }: { url?: string }) => {
|
||||
// during server side rendering don't prepend the BASE_URL
|
||||
const pbu = useContext(ServerContext) ? (s: string) => s : prependBaseUrl
|
||||
|
||||
const handleRouteChange = () => {
|
||||
// @ts-ignore
|
||||
window.goatcounter.count({
|
||||
path: location.pathname + location.search + location.hash,
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<UserProvider>
|
||||
<Router url={url}>
|
||||
<Router url={url} onChange={handleRouteChange}>
|
||||
<HomePage
|
||||
// @ts-ignore
|
||||
path={pbu('/')}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
<link rel="stylesheet" href="/node_modules/katex/dist/katex.css" />
|
||||
<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 -->
|
||||
<meta property="og:type" content="website" />
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user