Data Layer
A data layer is a structured JavaScript object on a web page that holds information about the page, user, and interactions in a consistent format. Tag management tools like Google Tag Manager read from it, so tracking tags pull clean, reliable data instead of scraping it from the page markup.
Why It Matters
The data layer separates the data your tags need from the site's design and code. This makes tracking more stable when the site changes, and it lets you pass rich context, like product details or user type, into analytics and ad platforms.
Common Mistake
Letting developers and marketers work without a shared naming convention for data layer variables. Inconsistent keys break tags silently and force constant rework whenever the site is updated.