title: react.js Google analytics not working. no realtime data is shown
body: <p>react.js Google analytics not working. no realtime data is shown. I'm also using firebase database
  need some help</p>
  <pre><code>import ReactGA from 'react-ga';
  
  function App() {
    useEffect(() =&gt; {
      ReactGA.initialize('G-6R4D4957DM');
       // To Report Page View 
      ReactGA.pageview(window.location.pathname + window.location.search);
    }, [])
      
    useEffect(() =&gt; {
      console.log(window.location.pathname)
    }) 
  
    return (
      &lt;&gt; 
        &lt;ThemeProvider theme={Theme}&gt;
          &lt;Navbar/&gt;
          &lt;Switch&gt;
            {/* &lt;Route exact path=&quot;/&quot; component={Home}/&gt; */}
            &lt;Route exact path=&quot;/&quot; component={Properties} className=&quot;Properties&quot;/&gt;
            &lt;Route exact path=&quot;/sinnerthedog2Login/&quot; component={Adminindex} /&gt;
            &lt;Route exact path=&quot;/sinnerthedog2/&quot; component={AdminPannel} className=&quot;Properties&quot;/&gt;
            &lt;Route exact path=&quot;/:slug&quot; component={Singlepage}/&gt;
            {/* &lt;Route exact path=&quot;/sinnerthedog2/&quot; component={AdminPannel}/&gt; */}
            &lt;Route component={Error}/&gt;
          &lt;/Switch&gt;
        &lt;/ThemeProvider&gt;
      &lt;/&gt;
    );
  }
      
  export default App;
  </code></pre>