Skip to content

Commit

Permalink
google analytics only in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
neural-loop committed Dec 31, 2023
1 parent 547864e commit cd0568a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion themes/hugoplate/layouts/partials/essentials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
{{/* template "_internal/google_analytics.html" . */}}
{{/* end */}}

{{ if hugo.IsProduction }}
<script async src="https://www.googletagmanager.com/gtag/js?id=G-WLX91Y92H4"></script>
<script>
window.dataLayer = window.dataLayer || [];
Expand All @@ -47,7 +48,7 @@

gtag('config', 'G-WLX91Y92H4');
</script>

{{ end }}
<!-- google tag manager -->
{{/* partialCached "gtm.html" . */}}

Expand Down

0 comments on commit cd0568a

Please sign in to comment.