tpl: Trim whitespace from google_analytics.html

This commit is contained in:
Patrice Chalin 2024-08-29 15:32:46 -04:00 committed by GitHub
parent 37609262dc
commit 53a8de21b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,8 +1,8 @@
{{ if not site.Config.Privacy.GoogleAnalytics.Disable }} {{ if not site.Config.Privacy.GoogleAnalytics.Disable }}
{{ with site.Config.Services.GoogleAnalytics.ID }} {{- with site.Config.Services.GoogleAnalytics.ID }}
{{ if strings.HasPrefix (lower .) "ua-" }} {{- if strings.HasPrefix (lower .) "ua-" }}
{{ warnf "Google Analytics 4 (GA4) replaced Google Universal Analytics (UA) effective 1 July 2023. See https://support.google.com/analytics/answer/11583528. Create a GA4 property and data stream, then replace the Google Analytics ID in your site configuration with the new value." }} {{- warnf "Google Analytics 4 (GA4) replaced Google Universal Analytics (UA) effective 1 July 2023. See https://support.google.com/analytics/answer/11583528. Create a GA4 property and data stream, then replace the Google Analytics ID in your site configuration with the new value." }}
{{ else }} {{- else }}
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script> <script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
<script> <script>
var doNotTrack = false; var doNotTrack = false;
@ -17,6 +17,6 @@
gtag('config', '{{ . }}'); gtag('config', '{{ . }}');
} }
</script> </script>
{{ end }} {{- end }}
{{ end }} {{- end }}
{{ end }} {{- end -}}