Skip to content

Commit 842b540

Browse files
Prevent cookiepro scripts from being loaded in staging
1 parent 8184874 commit 842b540

File tree

1 file changed

+6
-2
lines changed
  • en/theme/material/partials/javascripts

1 file changed

+6
-2
lines changed

en/theme/material/partials/javascripts/base.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
<!-- Google Tag Manager -->
1313
<script>
14+
if (window.location.hostname.endsWith('wso2.com')) {
1415
(function(w, d, s, l, i) {
1516
w[l] = w[l] || [];
1617
w[l].push({
@@ -26,5 +27,8 @@
2627
'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
2728
f.parentNode.insertBefore(j, f);
2829
})(window, document, 'script', 'dataLayer', 'GTM-PSTXMT');
29-
</script>
30-
<!-- End Google Tag Manager -->
30+
} else {
31+
console.warn("GTM not loaded: not on an allowed domain");
32+
}
33+
</script>
34+
<!-- End Google Tag Manager -->

0 commit comments

Comments
 (0)