Skip to content
BENIBIX Learn

Data Layer

Marketing🛠️ MarTech, Data & AIData Collection

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

A data layer is a shared list of facts that a web page writes for its tracking tools to read. When something happens, like a sale, the page adds a note with the details. The tag manager reads the note and passes the facts to each tool. So the tags do not have to dig through the page to find the price. When the page design changes, the tracking keeps working.

Example code

javascript
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event: "purchase", value: 42.5, currency: "EUR" });
The page writes one note: a purchase worth 42.50 euros just happened.
The data layer sits between the page and the tags. The page writes to it, and the tags read from it.

Common mistake

Letting each team name events its own way. Agree on one list of event names first.

Key takeaways

  1. 1
    The page writes. The site states the facts.
  2. 2
    The tags read. Each tool takes what it needs.
  3. 3
    One naming plan. Every event has an agreed name.