Short answer
The data layer is a list on your website where the site writes information for Google Tag Manager to read, like 'purchase completed, order 4821, $120'. GTM then sends that data to GA4, Google Ads, Meta and others.
How it works
Your website runs a line like dataLayer.push({event: 'purchase', ecommerce: {value: 120}}). GTM listens for that event, reads the values and fires the right tags. Every platform then gets the same order ID, value and products.
Why it beats scraping the page
- Values come straight from your store or app, not from text on the page.
- A page redesign doesn't break tracking.
- One source of data for every platform, so numbers match.
Common problems
- The push happens after GTM already fired the tag, so values are missing.
- Field names don't match what GA4 expects, e.g.
pricevsvalue. - The
ecommerceobject isn't cleared, so old values leak into new events. - A theme or app update removes the data layer code.
How to check it
- Open GTM Preview and complete a test purchase or form.
- Click the event and open the Data Layer tab.
- Check every value: order ID, total, currency and items.
Questions
Do I need a developer for the data layer?
Often for custom sites. Shopify and many platforms have built-in events you can use.
Is the data layer the same as GTM?
No. The data layer holds the information. GTM reads it and sends it on.