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.