Definition
A data layer is a JavaScript array, usually window.dataLayer, that a website uses to pass structured event and page data to Google Tag Manager.
In practice
Developers push events into it, for example dataLayer.push({event: 'purchase', value: 120, currency: 'USD'}). Tag Manager listens for those events and reads their values through data layer variables.
A well-designed data layer is the foundation of reliable tracking. It decouples tags from page markup, so a redesign does not silently break conversions, and it gives every destination the same IDs and values.
Common problems are missing transaction IDs, inconsistent event names between pages and user data captured after a form has already been cleared.
Learn more: Data layer design.
Related terms
- Server-side taggingServer-side tagging moves tag processing from the visitor’s browser to a server container you control.
- Key event (GA4)A key event is a Google Analytics 4 event you mark as important to your business, such as purchase, sign_up or generate_lead.
- Event deduplicationEvent deduplication is how an ad platform recognizes that a browser event and a server event describe the same action, so the conversion is counted once.
How Markitech helps
Markitech connects your AI to Google Ads, GA4, Google Tag Manager, Meta and 12 more platforms, so it can check how Data layer is set up in your own accounts and tags and propose fixes. Every change is held until you approve it.