title: how to add gtag.js to react.js/next.js index.js?
body: <p>I am sorry for this noob question, I just start to use a next.js template form <a href="https://github.com/zeit/next.js/tree/canary/examples/hello-world/pages" rel="noreferrer">https://github.com/zeit/next.js/tree/canary/examples/hello-world/pages</a>
  Normally I would just add gtag.js to index.html but for this next.js there is only index.js. The question is how I can include this? I had tried to make gtag as a component and try to import it and also include the script as it is inside render function of index.js but so far it is not working! please help me!</p>
  
  <p>Gtag:</p>
  
  <pre><code> &lt;script async src="https://www.googletagmanager.com/gtag/js? 
     id=GA_TRACKING_ID"&gt;&lt;/script&gt;
      &lt;script&gt;
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
  
    gtag('config', 'GA_TRACKING_ID');
  &lt;/script&gt;
  </code></pre>
  
  <p>index.js:</p>
  
  <pre><code>import Link from 'next/link'
  export default () =&gt; (
    &lt;div&gt;Hello World. &lt;Link href='/about'&gt;&lt;a&gt;About&lt;/a&gt;&lt;/Link&gt;&lt;/div&gt;
  )
  </code></pre>