mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-25 19:10:58 +00:00
Added async version of Google Analytics internal template
This commit is contained in:
parent
8f6f13104e
commit
ff28120e53
1 changed files with 9 additions and 0 deletions
|
@ -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 }}`)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue