From 6c8772aad17677fbb1a6ff13f2010163f87c448d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 1 Mar 2018 09:51:27 +0100 Subject: [PATCH] Add site to GA config --- themes/gohugoioTheme/layouts/partials/gtag.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/themes/gohugoioTheme/layouts/partials/gtag.html b/themes/gohugoioTheme/layouts/partials/gtag.html index bd3bdbd6e..e54f9b42e 100644 --- a/themes/gohugoioTheme/layouts/partials/gtag.html +++ b/themes/gohugoioTheme/layouts/partials/gtag.html @@ -5,7 +5,8 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); - gtag('config', '{{ . }}', {'branch': '{{ getenv "BRANCH" }}'}); + {{ $site := .Site.BaseURL | replaceRE "^https?://(www\\.)?([^/]+).*" "$2" }} + gtag('config', '{{ . }}', {'site': '{{ $site }}', 'branch': '{{ getenv "BRANCH" }}'}); /** * Function that tracks a click on an outbound link in Analytics.