mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
hugolib: Deprecate .Site.GoogleAnalytics
Use .Site.Config.Services.GoogleAnalytics.ID instead.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
d4016dd5cd
commit
a692278bc6
@@ -1,5 +1,5 @@
|
||||
{{- $pc := .Site.Config.Privacy.GoogleAnalytics -}}
|
||||
{{- if not $pc.Disable }}{{ with .Site.GoogleAnalytics -}}
|
||||
{{- if not $pc.Disable }}{{ with .Site.Config.Services.GoogleAnalytics.ID -}}
|
||||
{{ if hasPrefix . "G-"}}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
|
||||
<script>
|
||||
@@ -48,4 +48,4 @@ var doNotTrack = false;
|
||||
var dnt = (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack);
|
||||
var doNotTrack = (dnt == "1" || dnt == "yes");
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
Reference in New Issue
Block a user