feat: googleAnalytics
This commit is contained in:
parent
fc83e3314e
commit
14d0777437
0
.hugo_build.lock
Normal file
0
.hugo_build.lock
Normal file
@ -169,3 +169,7 @@ id = "e4f661ff-9a8c-49d4-b3cc-2efe553e3973"
|
||||
datacache = false
|
||||
url = "https://eu.umami.is/script.js"
|
||||
shareUrl = "https://eu.umami.is/share/RIETUMwZn4IBMIr8/hugo-theme-anubis2.netlify.app"
|
||||
|
||||
[params.GoogleAnalytics]
|
||||
enabled = true
|
||||
gtag = "G-T5LM1515MT"
|
8
layouts/partials/google_analytics.html
Normal file
8
layouts/partials/google_analytics.html
Normal file
@ -0,0 +1,8 @@
|
||||
<!-- Google tag (gtag.js) -->
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Params.GoogleAnalytics.gtag }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
gtag('js', new Date());
|
||||
gtag('config', '{{ .Site.Params.GoogleAnalytics.gtag }}');
|
||||
</script>
|
@ -103,8 +103,8 @@
|
||||
<meta property="article:tag" content="">
|
||||
<meta property="article:publisher" content="https://www.facebook.com/XXX"> -->
|
||||
|
||||
{{ if and (.Site.GoogleAnalytics) (hugo.IsProduction) }}
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
{{ if (.Site.Params.GoogleAnalytics.enabled) }}
|
||||
{{ partial "google_analytics.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ if (.Site.Params.UmamiAnalytics.enabled ) }}
|
||||
|
Loading…
Reference in New Issue
Block a user