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('/')}
|
||||
|
||||
Reference in New Issue
Block a user