Mysterious macro – Since it would make little sense to

Since it would make little sense to resolve variables before executing the surrounding JavaScript code, it follows that GTM does not resolve variables until a custom HTML tag is entered at the end of . The value of the variable must match the value of the entered custom HTML tag. When you create a custom HTML tag in Google Tag Manager, you are actually creating HTML elements that are added to the end of the element when the tag is triggered. Now, when a Google Tag Manager variable is added to a custom HTML tag, the syntax {{{variableName}} is used. In order for variables to wait for injection, this must mean that the variables themselves must be some sort of function call that will execute and resolve the surrounding script after the tag is injected. The main exception to this rule is variables converted to strings, which Google Tag Manager must resolve before injection, otherwise it will convert the function expression itself to a string, which is not appropriate.

Written by

Steven has over 12 years of internet experience, from design, to programming to internet marketing. It's his background in branding and marketing that led him to the path of protecting his clients reputation online, a specialized field that he has received years of training. When he is not researching the latest online marketing trends, you can find Austin meeting with clients and working to deliver businesses the results they need.