<script>
html node on every page of your website that holds a src
attribute that points to the Container URL. TagCommander differentiates two types of Container to define whether the Container should be placed in the <head>
or in the <body>
section of the HTML document.<head>
Container<head>
Container are used to implement A/B-testing and personalisation Tags that usually impact the visual content of a website before it is presented to the user. Therefore it is important to place them as high as possible in the <head>
section of your website.<head>
Container file is loaded synchronously to avoid potential content flickering effects.<body>
Container<body>
Container are used to implement Tags that measure information. These Containers are therefore placed at the end of the <body>
section to make sure they have minimal impact on the loading time of the content of the website.<head>
Container it is possible to implement <body>
Container asynchronously. For example it is possible to load them via JavaScript on the onload
event of the page or it is possible to use the async
attribute in the <script>
element.tC.containersLaunched
provides information of each loaded TagCommander Container. tc_vars
that holds the meta data of the page as direct properties. The required Data Layer properties are defined during the TagCommander setup process, but you can find a list of common properties here.<head>
and a <body>
Container are used on a website.env_
is used to group environment information and user_
is used to group user information.product_name
on the privacy policy page) it is recommended to fill it with an empty value (e.g. ""
, 0
, []
or {}
).tc_vars
.tc_vars
Data Layer in the JavaScript Console.event_label
, event_type
and event_value
—so in case of an add_to_basket
Trigger the event_value
would hold the product id of the selected product and in case of a video_play
event the event_value
would hold the current position within the video timeline. This allows to avoid to create multiple custom variable names for each individual event and therefore makes Trigger more generic.ReferenceError
. Therefore it is recommended to check the availability of the Trigger function before using it.