Preparing tool...
Preparing tool...
A JavaScript array that temporarily holds structured data on your website so Google Tag Manager can accurately read it and send it to analytics tools.
The Data Layer is the foundational bridge between your website's backend (the CMS, the shopping cart) and your marketing tags.
Instead of forcing GTM to "scrape" the page for a product price computationally (which breaks if the design changes), your developers explicitly push the price into the Data Layer when a product is viewed.
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'add_to_cart',
'ecommerce': {
'currency': 'USD',
'value': 29.99,
'items': [{
'item_id': 'SKU_12345',
'item_name': 'Nice Tool Widget'
}]
}
});
If your GTM variables are failing or e-commerce data is missing, the very first thing an audit checks is the integrity and formatting of your Data Layer pushes.
Stop guessing. Get a free audit of your exact setup, then let your 24/7 web analyst keep watching every night.