Skip to content

Commit 9f95cfe

Browse files
Merge pull request #865 from keboola/fix/disable-gtm-locally
fix: disable GTM in local development to prevent cookie consent popup
2 parents 96d7e62 + bdb3969 commit 9f95cfe

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

_includes/gtm-body.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
{% if jekyll.environment == "production" %}
12
<!-- Google Tag Manager (noscript) -->
23
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WMTTBS"
34
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
4-
<!-- End Google Tag Manager (noscript) -->
5+
<!-- End Google Tag Manager (noscript) -->
6+
{% endif %}

_includes/gtm-head.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
{% if jekyll.environment == "production" %}
12
<!-- Google Tag Manager -->
23
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
34
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
45
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
56
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
67
})(window,document,'script','dataLayer','GTM-WMTTBS');</script>
7-
<!-- End Google Tag Manager -->
8+
<!-- End Google Tag Manager -->
9+
{% endif %}

0 commit comments

Comments
 (0)