forked from LiveCarta/LiveCartaWP
enable GTM for all env
This commit is contained in:
@@ -49,15 +49,13 @@ $scripts = [];
|
||||
</script>
|
||||
|
||||
<?php $scripts[] = ['type' => 'script', 'source' =>"https://www.googleoptimize.com/optimize.js?id=OPT-TCXZSGK"]; ?>
|
||||
<?php if (LAWCARTA_ENVIRONMENT_NAME == 'prod'):?>
|
||||
<?php $scripts[] = ['type' => 'comment', 'source' =>'Google Tag Manager']; ?>
|
||||
<?php $scripts[] = ['type' => 'script', 'source' =>"(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
||||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
||||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
||||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||
})(window,document,'script','dataLayer','GTM-K8LWZ6K');"]; ?>
|
||||
})(window,document,'script','dataLayer','".LC_GTM."');"]; ?>
|
||||
<?php $scripts[] = ['type' => 'comment', 'source' =>'End Google Tag Manager']; ?>
|
||||
<?php endif;?>
|
||||
<?php if(
|
||||
(isset($_COOKIE['cookie_level']) && in_array($_COOKIE['cookie_level'],['13','123']))
|
||||
|| LC_ALLOW_COOKIE_POPUP == false
|
||||
@@ -104,7 +102,7 @@ $scripts = [];
|
||||
</head>
|
||||
<body <?php body_class(); ?>>
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-K8LWZ6K"
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=<?=LC_GTM ?>"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user