mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
tpl/tplimpl/embedded: Wrap the relevant templates with the privacy policy disable check
See #4616
This commit is contained in:
@@ -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 -}}
|
Reference in New Issue
Block a user