hugo/tpl/tplimpl/embedded/templates/google_analytics_async.html
Bjørn Erik Pedersen 35ccf06dae
Fix some recently broken embedded templates
And add tests for them.

Fixes #4757
2018-05-23 10:03:11 +02:00

14 lines
No EOL
426 B
HTML
Executable file

{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
{{- if not $pc.Disable -}}
{{ with .Site.GoogleAnalytics }}
<script>
{{ template "__ga_js_set_doNotTrack" $ }}
if (!doNotTrack) {
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 -}}