Complete GA4 E-commerce Tracking Setup: Purchase Events, Funnels & Debugging
Most GA4 e-commerce setups are broken by default. This step-by-step guide covers purchase event schema, GTM configuration, DebugView verification, and the 3 duplicate-purchase bugs that silently inflate your conversion counts.
AttriModel Team
AttriModel Team
Why GA4 E-commerce Tracking Matters
GA4's e-commerce tracking gives you visibility into every step of your customer's buying journey — from product discovery to purchase. Unlike Universal Analytics, GA4 uses an event-based model that captures richer data with fewer custom configurations.
Before You Start
You'll need:
- Google Tag Manager installed on your site
- A GA4 property created in Google Analytics
- Access to your site's data layer or developer support
Step 1: Enable E-commerce in GA4
In your GA4 property, go to Admin → Events and ensure purchase, add_to_cart, and view_item events are marked as conversions.
Step 2: Set Up the Data Layer
Your developer needs to push e-commerce data to the data layer. Here's the standard structure for a purchase event:
`javascript
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'purchase',
'ecommerce': {
'transaction_id': 'T12345',
'value': 59.99,
'currency': 'USD',
'items': [{
'item_id': 'SKU_001',
'item_name': 'Running Shoes',
'price': 59.99,
'quantity': 1
}]
}
});
`
Step 3: Configure GTM Tags
In GTM, create a GA4 Event tag for each e-commerce event:
- Trigger: Custom Event matching your data layer event name
- Variable: Data Layer Variable reading the ecommerce object
Step 4: Test with GA4 DebugView
Enable DebugView in GA4 and use GTM Preview mode to verify events fire correctly. Check that all required parameters (currency, value, items) are populated.
Common Issues
- Missing currency parameter: GA4 requires currency for all purchase events
- Items array empty: Ensure your data layer push fires after cart/product data is available
- Duplicate events: Check for both GTM tags and hardcoded gtag.js calls
Next Steps
Once purchase tracking is working, implement view_item, add_to_cart, and begin_checkout to get full funnel visibility in GA4's Funnel Exploration report.