diff --git a/examples/with-google-analytics/pages/_app.js b/examples/with-google-analytics/pages/_app.js index 2e394545b5c4..7c37a3b61de2 100644 --- a/examples/with-google-analytics/pages/_app.js +++ b/examples/with-google-analytics/pages/_app.js @@ -10,8 +10,10 @@ const App = ({ Component, pageProps }) => { gtag.pageview(url) } router.events.on('routeChangeComplete', handleRouteChange) + router.events.on('hashChangeComplete', handleRouteChange) return () => { router.events.off('routeChangeComplete', handleRouteChange) + router.events.off('hashChangeComplete', handleRouteChange) } }, [router.events])