Data Layer

A data layer is a JavaScript structure on a website that holds structured information such as product prices, order values or user status in one central place before it is passed to a tag management system like Google Tag Manager. It decouples website development from tracking configuration, because tags read defined variables instead of brittle HTML structure.

In practice

In practice, website developers push events into the data layer with dataLayer.push(), for example when a purchase is completed, including items, quantity and price, while Google Tag Manager reads those values through variables and passes them on to GA4 or Google Ads. A properly documented data layer plan stops tracking from breaking again with every website change because of unstable CSS selectors, and it is the basic requirement for reliable e-commerce tracking.

Matching service

Sources

← Back to the glossary