mirror of
https://github.com/gohugoio/hugo.git
synced 2024-07-05 08:42:12 +00:00
Added async version of Google Analytics internal template
This commit is contained in:
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('create', '{{ . }}', 'auto');
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
</script>
|
</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 }}`)
|
{{ end }}`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue