How to Set Up E-Commerce Data Layer with GTM
The e-commerce data layer provides structured product and transaction data to GTM. Push events at each stage: view_item (product page), add_to_cart (cart button click), begin_checkout (checkout start), purchase (order confirmation). Each event includes an items array with item_id, item_name, price,
Quick Summary
The e-commerce data layer provides structured product and transaction data to GTM. Push events at each stage: view_item (product page), add_to_cart (cart button click), begin_checkout (checkout start), purchase (order confirmation). Each event includes an items array with item_id, item_name, price, quantity, currency, and optional brand/category/variant. Create Data Layer Variables in GTM for ecommerce.items, ecommerce.value, ecommerce.transaction_id. Fire GA4 Event tags on each custom event. Shopify and WooCommerce have plugins that handle data layer implementation automatically.
Overview
The e-commerce data layer provides structured product and transaction data to GTM. Push events at each stage: view_item (product page), add_to_cart (cart button click), begin_checkout (checkout start), purchase (order confirmation). Each event includes an items array with item_id, item_name, price, quantity, currency, and optional brand/category/variant. Create Data Layer Variables in GTM for ecommerce.items, ecommerce.value, ecommerce.transaction_id. Fire GA4 Event tags on each custom event. Shopify and WooCommerce have plugins that handle data layer implementation automatically.
Related Guides
See our complete guide library for detailed coverage of setup, tracking, analysis, and optimisation across all platforms.
Process Flow
Interactive diagram — drag to pan, scroll to zoom
Step-by-Step Guide
Follow these 3 steps to complete this guide
Step-by-Step Setup
Best Practices
Common Issues and Solutions
Frequently Asked Questions
Common questions about this topic
Was this guide helpful?
Your feedback helps us improve our guides