Merge ecc6619f09
into 01f9e43e59
This commit is contained in:
commit
806b10f099
|
@ -32,7 +32,7 @@ Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-manageme
|
|||
|
||||
## Twitter Simple Shortcode
|
||||
|
||||
{{< twitter_simple 1085870671291310081 >}}
|
||||
{{< x user="" id="1085870671291310081" >}}
|
||||
|
||||
<br>
|
||||
|
||||
|
|
|
@ -1,4 +1,22 @@
|
|||
{{ if not .Site.IsServer }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{ end }}
|
||||
{{ if not site.Config.Privacy.GoogleAnalytics.Disable }}
|
||||
{{- with site.Config.Services.GoogleAnalytics.ID }}
|
||||
{{- 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." }}
|
||||
{{- else }}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
|
||||
<script>
|
||||
var doNotTrack = false;
|
||||
if ({{ site.Config.Privacy.GoogleAnalytics.RespectDoNotTrack }}) {
|
||||
var dnt = (navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack);
|
||||
var doNotTrack = (dnt == "1" || dnt == "yes");
|
||||
}
|
||||
if (!doNotTrack) {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ . }}');
|
||||
}
|
||||
</script>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
Loading…
Reference in New Issue