fix google analytics code for real
authorDan Allen <dan@opendevise.com>
Fri, 5 Jul 2019 21:35:15 +0000 (15:35 -0600)
committerDan Allen <dan@opendevise.com>
Fri, 5 Jul 2019 21:35:15 +0000 (15:35 -0600)
src/partials/head-scripts.hbs

index ddbaa95..41ad69e 100644 (file)
@@ -1,4 +1,4 @@
     {{#if site.keys.googleAnalytics}}
     <script async src="https://www.googletagmanager.com/gtag/js?id={{site.keys.googleAnalytics}}"></script>
-    <script>(window.dataLayer=window.dataLayer||[]).push(['js',new Date()],['config','{{site.keys.googleAnalytics}}'])</script>
+    <script>function gtag(){dataLayer.push(arguments)};window.dataLayer=window.dataLayer||[];gtag('js',new Date());gtag('config','{{site.keys.googleAnalytics}}')</script>
     {{/if}}