The data layer is a key concept in Google Tag Manager. It gives us the flexibility and implementation that is needed in order to effectively track events across websites.
In this article, we’re going to demystify the Google Tag Manager Data Layer by explaining what it is and why it is needed.
Let’s get started.
What is the Google Tag Manager data layer?
In order to understand what the GTM data layer is, we first need to understand what a data layer is. In the context of programming, there are three different types of ‘layers’:
- The presentation layer
- The business layer
- The data layer
The business layer is the layer that corresponds to business rules and workflows that help determine how data is created, stored, and changed.
The data layer is the layer that acts as the source of customer interaction data, website-related data, and campaign data. The data layer contains all the data you want to send to Google Analytics.
In layman’s terms, the GTM Data Layer is like a virtual layer on your website that contains various data points that GTM uses.
Why is a GTM data layer needed?
The presentation layer of a website is often updated and can change at any time with, or without your knowledge; if this were to happen, your tag would stop working.
A GTM data layer provides a reliable way to pull required data from the presentation layer and send it to the GTM container tag. Pulling data this way means that regardless of what happens to the HTML DOM, the data layer will remain the same and your tags will continue to remain functional.