Skip to content

Commit 7aa5a90

Browse files
authored
Merge pull request #34251 from dradetsky/disable-gtag-in-local
Omit Google Analytics code for local Hugo website build
2 parents 9ec0036 + 49d73dc commit 7aa5a90

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

layouts/partials/head.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{{- else -}}
77
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
88
{{- end -}}
9+
{{- if in (slice "production" "nonprod") hugo.Environment -}}
910
<!-- Global site tag (gtag.js) - Google Analytics -->
1011
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-36037335-10"></script>
1112
<script>
@@ -15,6 +16,7 @@
1516

1617
gtag('config', 'UA-36037335-10');
1718
</script>
19+
{{- end -}}
1820

1921
<!-- alternative translations -->
2022
{{ range .Translations -}}

0 commit comments

Comments
 (0)