Skip to content

Commit

Permalink
Simplified GA PageView tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeraze committed Nov 20, 2022
1 parent 338ed22 commit 6300ca3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function App({ Component, pageProps }: AppProps) {
}

if (googleAnalyticsId) {
ReactGA.send({hitType: 'pageview', page: '$pageview'})
ReactGA.send("pageview")
}
}

Expand All @@ -61,6 +61,7 @@ export default function App({ Component, pageProps }: AppProps) {
}

if (googleAnalyticsId) {
console.error('Initializing ReactGA')
ReactGA.initialize( googleAnalyticsId)
}
router.events.on('routeChangeComplete', onRouteChangeComplete)
Expand Down

0 comments on commit 6300ca3

Please sign in to comment.