tpl/tplimpl/embedded: Wrap the relevant templates with the privacy policy disable check

See #4616
This commit is contained in:
Bjørn Erik Pedersen
2018-05-20 20:00:29 +02:00
parent 0bbdef986d
commit 6789207347
9 changed files with 69 additions and 21 deletions

View File

@@ -1,3 +1,5 @@
{{- $pc := .Page.Site.PrivacyConfig.GoogleAnalytics -}}
{{- if not $pc.Disable -}}
{{ with .Site.GoogleAnalytics }}
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
@@ -5,4 +7,5 @@ ga('create', '{{ . }}', 'auto');
ga('send', 'pageview');
</script>
<script async src='//www.google-analytics.com/analytics.js'></script>
{{ end }}
{{ end }}
{{- end -}}