mirror of
https://github.com/theNewDynamic/gohugo-theme-ananke.git
synced 2025-06-08 09:12:47 +00:00
try and fix g-analytics
make use of gtag code provided by g-analytics console as a partial here
This commit is contained in:
parent
a711406964
commit
698c637299
@ -37,7 +37,7 @@
|
||||
{{- template "_internal/twitter_cards.html" . -}}
|
||||
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{ partial "analytics-gtag.html" . }}
|
||||
{{ end }}
|
||||
{{ block "head" . }}{{ partial "head-additions.html" . }}{{ end }}
|
||||
</head>
|
||||
|
9
layouts/partials/analytics-gtag.html
Normal file
9
layouts/partials/analytics-gtag.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.GoogleAnalytics }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
|
||||
gtag('config', '{{ .Site.GoogleAnalytics }}');
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user