From d29e4da3e683a4c17c609ace5dd92cd2126b1ed9 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 19 Jun 2022 00:39:44 +0200 Subject: Add support for Global site tag (gtag.js) - Google Analytics --- layouts/partials/head.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'layouts/partials/head.html') diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 0c9329d..e77e902 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -11,7 +11,8 @@ {{ hugo.Generator }} - {{- partial "styles.html" . }} + {{ partial "styles.html" . }} + {{ partial "data.html" . }} {{ block "custom-scripts" . }}{{ partial "custom-scripts.html" . }}{{ end }} {{- /* Favicons */}} @@ -29,6 +30,16 @@ {{ block "custom-head" . }}{{ partial "custom-head.html" . }}{{ end }} + {{ with site.GoogleAnalytics }} + {{ $ga := resources.Get "js/ga.js" | minify | fingerprint }} + {{ if not site.Params.assets.disable_fingerprinting }} + {{ $ga = $ga | fingerprint }} + + {{ else }} + + {{ end }} + {{ end }} + {{- /* Misc */}} {{ template "partials/templates/opengraph.html" . }} {{ template "partials/templates/twitter_cards.html" . }} -- cgit v1.2.3