feat: added analytics

This commit is contained in:
2023-01-11 18:09:21 +01:00
parent 0955f18e04
commit a236c662af
2 changed files with 10 additions and 1 deletions
+8 -1
View File
@@ -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('/')}