add support for GA v4 #84

This commit is contained in:
Dmitry Kolosov 2021-04-11 17:00:58 +03:00
parent 1ddecf607d
commit f78a7b2f98

View File

@ -39,8 +39,12 @@
<meta property="article:tag" content="">
<meta property="article:publisher" content="https://www.facebook.com/XXX"> -->
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
{{ template "_internal/google_analytics_async.html" . }}
{{ if and (.Site.GoogleAnalytics) (or (eq (getenv "HUGO_ENV") "production") (eq .Site.Params.env "production")) }}
{{ if hasPrefix .Site.GoogleAnalytics "UA-" }}
{{ template "_internal/google_analytics_async.html" . }}
{{ else }}
{{ template "_internal/google_analytics.html" . }}
{{ end }}
{{ end }}
{{ partial "head-extra.html" . }}