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>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -8,4 +10,5 @@ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
ga('create', '{{ . }}', 'auto');
ga('send', 'pageview');
</script>
{{ end }}
{{ end }}
{{- end -}}