Added async version of Google Analytics internal template

This commit is contained in:
Wade Fitzpatrick 2015-12-17 15:56:16 +10:00 committed by Steve Francia
parent 8f6f13104e
commit ff28120e53

View file

@ -232,5 +232,14 @@ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
ga('create', '{{ . }}', 'auto');
ga('send', 'pageview');
</script>
{{ end }}`)
t.AddInternalTemplate("", "google_analytics_async.html", `{{ with .Site.GoogleAnalytics }}
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', '{{ . }}', 'auto');
ga('send', 'pageview');
</script>
<script async src='//www.google-analytics.com/analytics.js'></script>
{{ end }}`)
}