mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
Added async version of Google Analytics internal template
This commit is contained in:
committed by
Steve Francia
parent
8f6f13104e
commit
ff28120e53
@@ -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 }}`)
|
||||
}
|
||||
|
Reference in New Issue
Block a user