Skip to content Skip to sidebar Skip to footer

Console Returns Value But Google Tag Manager Variable Does Not

When I put dataLayer[1].ecommerce.checkout.products[0].metric2 in the console, it return the correct value. However, when I try to extract the value from a Custom JavaScript variab

Solution 1:

In case your questions hasn't been answered yet: The thing is you yon't want to reference the dataLayer array inside a dataLayer variable in GTM. This does not make sense, because you already are in the dataLayer "namespace". If you reference the field by simply writing ecommerce./*...*/.metric2 and leaving out the dataLayer[1] part, it will work.


Post a Comment for "Console Returns Value But Google Tag Manager Variable Does Not"