diff options
author | Julian <julian@vantage-design.com> | 2020-05-11 15:35:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 15:35:36 +0300 |
commit | 9912a441ec745cfebff66dc670d0ec06c8971381 (patch) | |
tree | b431e6346a151cc6f8fca168c580e687a990c15a | |
parent | f1217193f37aeb58d51c4a2f1e6069b56ac681a2 (diff) | |
parent | 0715006f893e9208775d505512175274b001fb84 (diff) |
Merge pull request #7 from jhollowe/patch-3
Allow Google Analytics to only track production site
-rw-r--r-- | layouts/partials/head.html | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e2b6a5a..1e7e079 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -17,6 +17,9 @@ {{ $style := resources.Get "css/ace.scss" | toCSS | minify }} <link rel="stylesheet" href="{{ $style.Permalink }}"> - {{ template "_internal/google_analytics_async.html" . }} + <!-- Only include the tracking when using `hugo` or adding `--environment production` --> + {{ if eq hugo.Environment "production" }} + {{ template "_internal/google_analytics_async.html" . }} + {{ end }} </head> |