Add support for Google Analytics v4

Hugo 0.82.0+ is required if you want to use Google Analytics v4
This commit is contained in:
vimux 2021-04-12 11:40:22 -04:00
parent ac6004e5ad
commit 2456799f6d
No known key found for this signature in database
GPG key ID: 5A34FDC4EE832E34

View file

@ -37,8 +37,12 @@
<link rel="manifest" href="{{ "manifest.json" | relURL }}">
{{- end }}
{{- if not .Site.IsServer }}
{{- if hasPrefix .Site.GoogleAnalytics "G-" }}
{{ template "_internal/google_analytics.html" . }}
{{- else }}
{{ template "_internal/google_analytics_async.html" . }}
{{- end }}
{{- end }}
</head>
<body class="body kind-{{ .Kind }}">
{{ partial "header" . }}