With Universal Analytics being sunset in favor of Google Analytics 4 (GA4), E-commerce tracking is essential to understanding your online store’s performance, providing data on sales, user behavior, and key conversion metrics. Google Analytics 4 (GA4) simplifies tracking with advanced features like event-based tracking and enhanced measurement. This guide walks you through setting up e-commerce tracking in GA4 for your online store.
If you’re new to GA4 or need expert help, check out our detailed guide GA4 Consulting.
Why Is E-commerce Tracking Important?
E-commerce tracking enables you to:
- Monitor your store’s performance.
- Analyze user behavior and optimize conversions.
- Track revenue, transactions, and average order value.
- Make informed business decisions based on real data.
To further understand how GA4 can provide deeper insights, you can learn to Track User Behavior in GA4 and use advanced features like Cross-Domain Tracking in Google Analytics 4 for seamless tracking across platforms.
Prerequisites for Setting Up E-commerce Tracking
Before starting, ensure you have:
- A GA4 Property: Set up a GA4 property for your website.
- Google Tag Manager (GTM): To implement tracking codes seamlessly.
- E-commerce Data Layer: Your developer must add an e-commerce data layer to the website.
- Access to Your Website’s Code: For adding the necessary tags or scripts.
Step-by-Step Guide to Set Up E-commerce Tracking in GA4
Step 1: Create a GA4 Property
- Log in to Google Analytics.
- Click Admin > Account Settings > Create Property.
- Enter your property name, select your reporting time zone, and currency.
- Click Next and complete the setup wizard.

Step 2: Enable Enhanced E-commerce in GA4
- Navigate to Admin in your GA4 property.
- Under Property Settings, select Data Streams.
- Click your website data stream and enable the Enhanced Measurement toggle.

Enhanced Measurement automatically tracks page views, scrolls, and clicks, essential for e-commerce tracking.
Step 3: Set Up E-commerce Events
GA4 uses predefined event names for e-commerce tracking. Ensure your website tracks the following events:
- view_item: When a user views a product.
- add_to_cart: When a user adds a product to their cart.
- begin_checkout: When a user starts the checkout process.
- purchase: When a transaction is completed.
Step 4: Implement Tracking Using Google Tag Manager
A. Install Google Tag Manager (if not already installed)
- Go to Google Tag Manager.
- Create a container for your website.
- Install the GTM container snippet on your website’s header and footer.

If you’re new to GTM, our blog What Is Google Tag Manager & How To Use It explains the basics and advanced implementation.
B. Create Tags for E-commerce Events
- Open your GTM container.
- Click Tags > New.
- Select Tag Type > GA4 Event Tag.
- Enter the event name (e.g., add_to_cart) and map the corresponding data layer variables for event parameters (e.g., product name, price, quantity).

Repeat this process for all e-commerce events (e.g., view_item, begin_checkout, purchase).
For professional assistance, explore GTM Consulting services tailored to your business needs.
C. Test Your Tags
- Click Preview in GTM to open the debug mode.
- Perform actions on your website (e.g., add a product to the cart).
- Verify that events fire correctly using the GTM debugger.

Step 5: Validate Events in GA4
- In your GA4 account, go to Reports > Events.
- Check if the events (view_item, add_to_cart, etc.) appear in the event list.
- Use the DebugView feature in GA4 for real-time testing.

For filtering unwanted internal traffic during validation, check our guide on Exclude Internal Traffic In GA4.
Step 6: Set Up Conversion Goals
- Go to Admin > Key Events.
- Click New Key Event.
- Add the key e-commerce events (e.g., purchase) as conversion events.

Step 7: Analyze E-commerce Data
After setup, you can analyze performance using:
- Monetization Reports: Track revenue, purchases, and top-selling products.
- Custom Reports: Create custom dashboards for detailed insights.

Common Issues and Troubleshooting Tips
- Events not firing? Check the GTM preview mode and ensure the data layer is properly implemented.
- Missing data? Verify your website sends all required parameters (e.g., product name, price) with events.
- No conversions tracked? Ensure you’ve added the correct events as conversions in GA4.
Final Thoughts
Setting up e-commerce tracking in GA4 is critical for optimizing your online store’s performance. By following this guide, you can track key metrics like sales, user behavior, and conversions with precision. Take your analytics game to the next level and make data-driven decisions to grow your business.
Saurabh Garg, the visionary Chief Technology Officer at Whitebunnie, is the driving force behind our cutting-edge innovations. With his profound expertise and relentless pursuit of excellence, he propels our company into the future, setting new standards in the digital realm.