mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +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>
|
||||
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 -}}
|
Reference in New Issue
Block a user