I am trying to add dataLayer variable values inside my tag, but when I look at the tag fired inside the Network tab of my console in Chrome, I see that the tag has been populated with undefined values, even though the dataLayer object in console has the right values.
Here is my dataLayer variable in GTM:
This is how I access the value inside the tag:
ORDERID={{ORDERID}}
And this is what I see as dataLayer values in console:
But inside the network tab, I see that the dataLayer variable is undefined:
This is how my Tag Manager's DataLayer in preview mode looks like:
Why?? I am pulling my hair over this now. How can I access dataLayer variable values?
Your ORDERID variable is correctly defined. Your tag which reads that variable should be fired on the "CHECKOUT: COMPLETE" event, otherwise that variable will be undefined.