title: Multiple installations of Global site tag (gtag.js) detected in Gatsby application
body: <p>I have Google Analytics code set up in my gatsby application.</p>
  
  <pre><code>&lt;script&gt;
      var gaId = "UA-xxxxxxxx-1";
      var JSLink = "https://www.googletagmanager.com/gtag/js?id=" + gaId;
      var JSElement = document.createElement('script');
      JSElement.src = JSLink;
      document.getElementsByTagName('head')[0].appendChild(JSElement);
  
  
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments)}
      gtag('js', new Date());
  
      gtag('config', gaId);
  
  &lt;/script&gt;
  </code></pre>
  
  <p>When I checked the site with Google Tag Assistant, it says there are multiple installations of the tracking code. </p>
  
  <p>How can I get rid of duplication installations of Global site tag? What recommendation for set up Google Analytics in React app?</p>
  
  <p><a href="https://i.stack.imgur.com/H7tUK.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/H7tUK.jpg" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/Dh1uJ.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Dh1uJ.jpg" alt="enter image description here"></a></p>