2018-05-23 04:03:11 -04:00
|
|
|
{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
|
2018-05-20 14:00:29 -04:00
|
|
|
{{- if not $pc.Disable -}}
|
2018-05-04 11:53:56 -04:00
|
|
|
{{ with .Site.GoogleAnalytics }}
|
|
|
|
<script>
|
2018-05-21 04:18:36 -04:00
|
|
|
{{ 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');
|
2018-05-25 04:53:39 -04:00
|
|
|
{{ if $pc.AnonymizeIP }}ga('set', 'anonymizeIp', true);{{ end -}}
|
2018-05-21 04:18:36 -04:00
|
|
|
}
|
2018-05-04 11:53:56 -04:00
|
|
|
</script>
|
|
|
|
<script async src='//www.google-analytics.com/analytics.js'></script>
|
2018-05-20 14:00:29 -04:00
|
|
|
{{ end }}
|
|
|
|
{{- end -}}
|