title: Combining Google Analytics (gtag.js) and Google Tag Manager (gtm.js)
body: <p>Google Analytics new migration to "Global site tag" using Google Tag manager confuses me a lot. It is Tag Manager, but it's not!?</p>
  
  <p>The regular <strong>Google Tag Manager</strong> integration looks like this:</p>
  
  <pre><code>&lt;!-- Google Tag Manager --&gt;
  &lt;script&gt;
    (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&amp;l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','GTM-XXXXXXX');
  &lt;/script&gt;
  </code></pre>
  
  <p>And the <strong>Google Analytics Global site tag</strong> integration like this:</p>
  
  <pre><code>&lt;!-- Global site tag (gtag.js) - Google Analytics --&gt;
  &lt;script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXXX-X"&gt;&lt;/script&gt;
  &lt;script&gt;
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    gtag('config', 'UA-XXXXXXXXX-X');
  &lt;/script&gt;
  </code></pre>
  
  <p>They load <strong>different resources</strong>. But <strong>both initiate the dataLayer</strong> push method. The way the object is created differs (supposing the two ways are interchangeable). Are we supposed to use both integrations side by side although the dataLayer object in one implementation conflicts the other?</p>
  
  <p>On a side note. Both resources are bundled with <strong>jQuery 1.9.1</strong>. While it can't be optimal to load and instantiate jQuery twice, (or thrice if we have our own jQuery on top of this). Are there any workarounds or recommendations?</p>