Pushing at Google Tag Manager the same variable, but they are duplicated -
using google tag manager, use variable in order know location of application. every time user changes section, js code pushes new value 'location' variable, this:
(function() { datalayergoogletagmanager.push({'location': 'tools'}); })();
my problem comes when check data layer, duplicates variable 'location' many different values. debugging in console:
obviously, when try value of 'location', result not want. know how fix this?
thank can provide
this ok - datalayer variables act display in console - when they're updated value changes.
if use gtm macro read value take latest one.
i use html tag show current macro values debugging purposes:
<script> console.log("*** gtm debugging console ***"); console.log("gtm event fired: " + {{event}}); console.log("debug mode: " + {{debug mode}}); console.log("location: " + {{location}}); </script>
create macro location , can view it's current value tag.
set tag rule event want debug, or alternatively set pages , block rule debug = false, show in debug mode.
Comments
Post a Comment