react.js Google analytics not working. no realtime data is shown

Viewed 1067

react.js Google analytics not working. no realtime data is shown. I'm also using firebase database need some help

import ReactGA from 'react-ga';

function App() {
  useEffect(() => {
    ReactGA.initialize('G-6R4D4957DM');
     // To Report Page View 
    ReactGA.pageview(window.location.pathname + window.location.search);
  }, [])
    
  useEffect(() => {
    console.log(window.location.pathname)
  }) 

  return (
    <> 
      <ThemeProvider theme={Theme}>
        <Navbar/>
        <Switch>
          {/* <Route exact path="/" component={Home}/> */}
          <Route exact path="/" component={Properties} className="Properties"/>
          <Route exact path="/sinnerthedog2Login/" component={Adminindex} />
          <Route exact path="/sinnerthedog2/" component={AdminPannel} className="Properties"/>
          <Route exact path="/:slug" component={Singlepage}/>
          {/* <Route exact path="/sinnerthedog2/" component={AdminPannel}/> */}
          <Route component={Error}/>
        </Switch>
      </ThemeProvider>
    </>
  );
}
    
export default App;
1 Answers
Related