score:0

have you included the cdn link and js for google analyctics in the head of html?

score:0

Have you tried adding the tracking code inside <head> in index.html (Admin -> Property -> Tracking code)?

score:0

Since you are using empty dependencies array in useEffect your code gets executed only once, when <App/> rendered. So you are not sending pageviews on route change.

You need to put pageview-related code before your App component, right after ReactGA initialization. It's a usage example from docs.

score:0

I had a similar issue try disabling your ad block if you have it active and put the ReactGA.initialize inside the useEffect


Related Query

More Query from same tag