Fix google analytics feature (#989)

* fix: Fix google analytics

* fix: Change respectDoNotTrack in GA html template

---------

Co-authored-by: Emruz Hossain <hossainemruz@gmail.com>
This commit is contained in:
JY Hsu 2024-11-27 07:59:35 +08:00 committed by GitHub
parent 515b7eb3bf
commit 3be5a58a7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 3 deletions

View file

@ -4,9 +4,7 @@
{{ with .services }}
<!-- Google Analytics -->
{{ with .google }}
{{ $privacyConfig:= dict (slice "Site" "Config" "Privacy" "GoogleAnalytics") $.Site.Config.Privacy.GoogleAnalytics }}
{{ $analyticsConfig := dict (slice "Site" "Config" "Services" "GoogleAnalytics" "ID") .id }}
{{ template "_internal/google_analytics.html" (merge $privacyConfig $analyticsConfig) }}
{{ partial "google_analytics.html" . }}
{{ end }}
<!-- Counter.dev -->