fix: loading the correct internal Google Analytics template for v4 token
Added if-clause to check prefix of googleAnalytics variable for v4 format ("G-"). Loading according internal template as specified in hugo docs.
Reviewed-by: Vladimir Doroch
Refs: #339
| | |
| | | </footer> |
| | | {{- partial "medium-zoom.html" .context -}} |
| | | {{- partial "math.html" .context -}} |
| | | {{- template "_internal/google_analytics_async.html" .context -}} |
| | | {{- if (hasPrefix .context.Site.GoogleAnalytics "G-") -}} |
| | | {{- template "_internal/google_analytics.html" .context -}} |
| | | {{- else -}} |
| | | {{- template "_internal/google_analytics_async.html" .context -}} |
| | | {{- end -}} |
| | | {{- if and (hugo.IsProduction) (.context.Site.Params.gtagId) -}} |
| | | {{ partial "google-analytics-gtag-async.html" .context }} |
| | | |