Variables
Capture dynamic content using variables
A tag can be used to record or transmit not only fixed values, but also dynamic information from the website. Content from cookies, the data layer, DOM elements or URL parameters can serve as sources. In the following, we explain how the individual tag types are filled and then used.
To configure variables, click on tag manager in the menu and select the sub-item My variables.

Cookie variable
Use the cookie variable to use cookie values for filling tag parameters. In addition to a name for the variable, all you need to do is enter the cookie name.

Data layer variable
Datalayer variables can be used to read out datalayers from a wide range of providers. To do this, enter the name of the data layer and the name of the corresponding variable and assign a name for the variable.

URL variable
Two options are available for the URL variable: GET parameter and Query. If GET parameter is selected, the value of a specific GET parameter can be used. To do this, simply enter the name of the desired GET parameter. If Query is selected, all content contained after the question mark is taken from the URL.

DOM variable
For DOM variables, the element from which the value is to be obtained must first be specified. This is done using the usual selection between CSS selector, element ID and element class.

You can then define whether the variable should be filled with the text of this element or whether the value of an attribute from this element should be used. If attribute value is selected, the attribute name must be specified. This also makes it possible to read so-called “data-attributes”.
Use variables
To use a variable in a tag, the variable must be selected in the appropriate parameter of the corresponding tag. In addition to fixed designations, integrated variables are available for selection that refer to the value from the element to which the trigger relates. You can also use your own variables, which can be filled from the four sources mentioned above and are dependent on the selected trigger.
