Intermediate
How to enable ecommerce tracking on Google Analytics
Quick Answer
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
1
Access Google Analytics Admin Settings
Log into your Google Analytics account and select the property you want to enable ecommerce tracking for. Click on Admin in the bottom left corner, then select Data Streams under the Property column.
Tip
Make sure you're working with a GA4 property, as Universal Analytics no longer supports new ecommerce setups.
2
Configure Enhanced Measurement
Click on your web data stream, then scroll down to Enhanced measurement and click the settings icon. Toggle on Purchases to automatically track ecommerce events. This enables basic purchase tracking for standard ecommerce platforms.
Tip
Enhanced measurement works automatically for most standard ecommerce platforms but may require custom implementation for unique setups.
3
Set Up Ecommerce Events
Navigate to Configure > Events in the left sidebar. Click Create event and set up key ecommerce events like
purchase, add_to_cart, and begin_checkout. Use the event builder to define conditions and parameters for each event.Tip
Focus on the most important events first: purchase, add_to_cart, and view_item for comprehensive tracking.
4
Configure Ecommerce Parameters
For each ecommerce event, add required parameters such as
currency, value, transaction_id, and items array. Go to Configure > Custom definitions > Custom metrics to create additional ecommerce metrics if needed.Tip
Always include transaction_id to prevent duplicate transactions and ensure accurate revenue reporting.
5
Implement Tracking Code
Add the Google Analytics tracking code to your website with ecommerce parameters. Use either the gtag.js library or Google Tag Manager. For purchases, implement code like:
gtag('event', 'purchase', {
transaction_id: '12345',
value: 25.42,
currency: 'USD',
items: [{
item_id: 'SKU123',
item_name: 'Product Name',
quantity: 1,
price: 25.42
}]
});Tip
Test your implementation on a staging environment before deploying to production.
6
Enable Ecommerce Reports
Go to Configure > Ecommerce and toggle on Enable ecommerce reporting. This activates dedicated ecommerce reports in your Analytics interface. You'll now see Monetization reports in the left navigation menu.
7
Verify Tracking Implementation
Use the DebugView report under Configure to test your ecommerce events in real-time. Make test purchases and verify that purchase events appear with correct parameters. Check the Monetization > Ecommerce purchases report after 24-48 hours for processed data.
Tip
Use Google Tag Assistant or browser developer tools to debug tracking issues before data appears in reports.
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.
Ready to get started with Google Analytics?
Put this tutorial into practice. Visit Google Analytics and follow the steps above.
Visit Google Analytics →