Back to glossary
Tag Management
What Is Data Layer?
A data layer is structured website data that tags and analytics tools use to read event, page, user, and ecommerce context.
Updated 2026-06-17
Quick Definition
A data layer is structured website data that tags and analytics tools use to read event, page, user, and ecommerce context.
Expanded explanation
A data layer gives tag managers and analytics tools a consistent place to read event, user, ecommerce, and page context.
Why it matters
A reliable data layer improves tag implementation quality by reducing fragile DOM scraping and inconsistent event logic. It supports cleaner GA4 events, conversion tracking, and governance.
Common mistakes
- Changing data layer keys without updating GTM variables and tags.
- Using inconsistent event names for the same user action.
- Pushing incomplete values after the tag that needed them has already fired.
Examples
dataLayer.push({ event: 'purchase' })
page_type: 'product'
Practical example
On purchase confirmation, a site can push dataLayer.push({ event: 'purchase', transaction_id: '1234', value: 149.00 }) so GTM can send reliable ecommerce data to GA4.