title: Google Analytics integration with React.js
body: <p>I tried to integrate Google Analytics in my React app but it just doesn't work properly. Sometimes I actually see results, sometimes I don't. This applies to all the methods that I used.</p>
  <p>My static web app is hosted on Netlify, so I tried to include my GA script in Netlify snippets before the <code>&lt;/head&gt;</code> tag and it didn't work. I also tried putting the GA script directly in my HTML head and it didn't work.</p>
  <p>I found a package named <code>react-ga4</code>: I tried using it but it didn't work either. When I open the network tab and refresh the page this is what I get:</p>
  <p><a href="https://i.stack.imgur.com/7sMQI.png" rel="nofollow noreferrer">Image here</a></p>