🛠️Data Layer
Also known as dataLayer, Tracking Data Layer
A list of facts a page writes for tracking tools. It holds things like price and product.
Think of it like
It is like a notice board in a kitchen. The cook writes what happened, and anyone can read it.
Example
The checkout page writes that a 42.50 euro order just happened. The tag manager sends that number to the analytics tool and to the ad pixel.
Why it matters
Tracking built on a data layer lives through a site redesign. Tracking that scrapes the page breaks.
Definition
Example code
javascript
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event: "purchase", value: 42.5, currency: "EUR" });Common mistake
Key takeaways
- 1The page writes. The site states the facts.
- 2The tags read. Each tool takes what it needs.
- 3One naming plan. Every event has an agreed name.