How to enable ecommerce tracking on Google Analytics
Enable ecommerce tracking in Google Analytics by navigating to Admin > Events > Enhanced measurement, then configuring purchase events and ecommerce parameters. You'll need to implement the gtag or Google Tag Manager code with ecommerce data on your website.
Prerequisites
- Google Analytics 4 property set up
- Admin access to your Google Analytics account
- Basic understanding of ecommerce events
- Website with purchase functionality
Step-by-Step Instructions
Access Google Analytics Admin Settings
Configure Enhanced Measurement
Set Up Ecommerce Events
purchase, add_to_cart, and begin_checkout. Use the event builder to define conditions and parameters for each event.Configure Ecommerce Parameters
currency, value, transaction_id, and items array. Go to Configure > Custom definitions > Custom metrics to create additional ecommerce metrics if needed.Implement Tracking Code
gtag('event', 'purchase', {
transaction_id: '12345',
value: 25.42,
currency: 'USD',
items: [{
item_id: 'SKU123',
item_name: 'Product Name',
quantity: 1,
price: 25.42
}]
});Enable Ecommerce Reports
Verify Tracking Implementation
Common Issues & Troubleshooting
Ecommerce data not appearing in reports
Check that Enable ecommerce reporting is turned on under Configure > Ecommerce. Verify your tracking code includes required parameters like transaction_id and value. Data can take 24-48 hours to appear in standard reports.
Duplicate transactions being recorded
Ensure each purchase event includes a unique transaction_id parameter. Implement client-side logic to prevent multiple firing of purchase events on thank you pages, or use server-side tracking for critical ecommerce events.
Revenue numbers don't match actual sales
Verify that the value parameter includes the correct total amount and currency parameter matches your actual currency. Check for missing or incorrectly implemented purchase events on all checkout completion pages.
Enhanced measurement not capturing purchases
Manually implement ecommerce tracking code if your platform doesn't follow standard ecommerce patterns. Go to Admin > Data Streams > Enhanced measurement and disable automatic purchase tracking if using custom implementation.