add Google Analytics tracking code if key is defined in model
authorDan Allen <dan@opendevise.com>
Sun, 4 Feb 2018 09:57:38 +0000 (02:57 -0700)
committerSarah White <sarah@opendevise.com>
Mon, 5 Feb 2018 02:13:03 +0000 (02:13 +0000)
src/partials/footer-scripts.hbs

index ea2a658..e45a1e5 100644 (file)
@@ -1,3 +1,6 @@
 <script src="{{uiRootPath}}/js/site.js"></script>
 <script src="{{uiRootPath}}/js/vendor/highlight.js"></script>
 <script>hljs.initHighlighting()</script>
+{{#if site.keys.googleAnalytics}}
+<script>!function(e,a,t,n,c,o,s){e.GoogleAnalyticsObject=c,e[c]=e[c]||function(){(e[c].q=e[c].q||[]).push(arguments)},e[c].l=1*new Date,o=a.createElement(t),s=a.getElementsByTagName(t)[0],o.async=1,o.src=n,s.parentNode.insertBefore(o,s)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","{{site.keys.googleAnalytics}}","auto"),ga("send","pageview")</script>
+{{/if}}