try another variant of the gtag code
authorDan Allen <dan@opendevise.com>
Fri, 23 Mar 2018 03:29:10 +0000 (21:29 -0600)
committerDan Allen <dan@opendevise.com>
Fri, 23 Mar 2018 03:29:10 +0000 (21:29 -0600)
src/partials/head-scripts.hbs

index 85fde65..2e8f175 100644 (file)
@@ -1,6 +1,14 @@
 {{#if site.keys.googleAnalytics}}
 {{#with site.keys.googleAnalytics}}
     <script async src="https://www.googletagmanager.com/gtag/js?id={{this}}"></script>
+    <!--
     <script>(window.dataLayer=window.dataLayer||[]).push(['js',new Date],['config','{{this}}'])</script>
+    -->
+    <script>
+window.dataLayer=window.dataLayer||[]
+function gtag(){dataLayer.push(arguments)}
+gtag('js',new Date())
+gtag('config','{{this}}')
+    </script>
 {{/with}}
 {{/if}}