I am trying to pick up the selected value for a drop down field on a form when the form is submitted. Through the developer console in Chrome, I can see the value I want in the GTM dataLayer. It is inside the gtm.element[1] in the screenshot. However, when I access that with dataLayer[5][“gtm.element”] the console returns the HTML for
Tag: google-datalayer
How to update a dataLayer variable?
We initially push an object containing variables to the dataLayer: We now want to increase the value of environment.clicks with every click a user makes. How to do that? When we push it via The dataLayer Array may get 10.000s of entries. How to properly update the variable? Answer The way to update a datalayer variable is to push a