What is a dataLayer?

On the very basic level you can control you tags using URL rules. This can include several use cases however sometimes you need more control over where and when to fire a tag.

The so called dataLayer can connect your Tag Manager container with your website and let you fire your tags on certain conditions. The dataLayer is a list of key-value pairs. You can define the key and the values as you wish. You can include the current page’s title, the users logged in status, product details, actually anything that is not connected to anyones personal data.

Remember: you can not use any Google product to track individual users. You can not include an email address in your dataLayer if this describes the currently logged in user. In general, you can not include any kind of personal identity information.

The dataLayer is actually a JavaScript variable that holds those key-value pairs. It is a tube between Tag Manager and your website. For example if someone clicks on a link on your page, you can push a special key called ‘event’ and pass a value like ‘LinkClicked’. You can create a rule in Tag Manager that fires a tag only if this event is being fired.