How to Use Google Analytics 4 for eCommerce Tracking
A Complete Guide
If you’re running an online store, you know how important data is. You need to understand where your customers come from, what products they love, and—most importantly—how to make more sales. That’s where Google Analytics 4 (GA4) comes in.
GA4 is the latest version of Google Analytics, and it’s packed with powerful tools to help you track your eCommerce performance. But let’s be real—setting it up can feel a little intimidating. Don’t worry, though! In this guide, I’ll walk you through everything step by step, from setting up GA4 to using advanced reports that will take your store’s performance to the next level.
What is Google Analytics 4?
Google Analytics 4 (GA4) is the latest version of Google’s web analytics platform, designed to provide more advanced tracking and insights into user behavior across websites and apps. It replaces Universal Analytics (UA) and introduces a new event-based data model, enhanced privacy controls, and deeper integration with Google’s AI-driven insights.
Key Features of GA4:
-
Event-Based Tracking – Unlike Universal Analytics, which relies on sessions and pageviews, GA4 tracks all interactions (clicks, scrolls, purchases, etc.) as events, providing a more flexible and detailed view of user behavior.
-
Cross-Platform Tracking – GA4 seamlessly tracks users across websites, apps, and devices, making it ideal for businesses with multiple digital touchpoints.
-
AI-Driven Insights – Google’s machine learning predicts trends, detects anomalies, and provides insights like churn probability or potential revenue.
-
Privacy-Focused Approach – With stricter privacy laws (GDPR, CCPA), GA4 offers cookieless tracking, consent mode, and data retention controls.
-
Deeper Integration with Google Ads – GA4 helps optimize ad campaigns by providing better audience insights and predictive metrics.
-
Free BigQuery Export – Users can export raw data to BigQuery for more advanced analysis, which was previously a premium feature in Universal Analytics.
-
Enhanced Reporting & Customization – GA4 offers new reporting tools like Exploration reports, Funnel Analysis, and Custom Audiences, making data analysis more flexible.
Why Should You Switch to GA4?
-
Universal Analytics stopped processing new data on July 1, 2023.
-
GA4 provides better insights into customer journeys rather than just session-based analytics.
-
Future-proofing your data strategy with AI, privacy compliance, and predictive analytics.
Would you like guidance on setting up GA4 or interpreting its reports?
Setting Up Google Analytics 4 for eCommerce
Before you can start tracking sales, you need to set up GA4 properly. Here’s how:
1. Create a GA4 Property
- Go to Google Analytics
- Click Admin > Create Property
- Choose GA4 and follow the setup instructions
2. Install GA4 Tracking Code
You need to add the tracking code to your website. If you’re using Shopify, WooCommerce, or another eCommerce platform, you can install GA4 using plugins or built-in integrations.
3. Set Up Google Tag Manager (GTM)
Google Tag Manager makes event tracking easier. Here’s how to connect it:
- Install Google Tag Manager on your site
- Create a new tag for GA4
- Set up triggers for key eCommerce events (more on this later)
4. Enable Enhanced eCommerce Tracking
In GA4, go to Admin > Data Streams > Web and turn on Enhanced Measurement. This allows GA4 to track things like site searches, outbound clicks, and scrolling behavior.
Key eCommerce Metrics to Track in GA4
Tracking the right eCommerce metrics in Google Analytics 4 (GA4) can help you understand customer behavior, optimize conversions, and increase revenue. Here are the key eCommerce metrics you should focus on:
1. Revenue & Sales Performance
-
Total Revenue – Measures the total income generated from eCommerce transactions.
-
Average Order Value (AOV) – Revenue per transaction. Formula:
AOV=Total RevenueTotal OrdersAOV = \frac{\text{Total Revenue}}{\text{Total Orders}}
-
Revenue by Traffic Source – Identifies which marketing channels drive the most revenue.
-
Revenue by Product Category – Helps determine the best-performing products.
2. Conversion Metrics
-
eCommerce Conversion Rate (CVR) – The percentage of visitors who complete a purchase. Formula:
CVR=(TransactionsSessions)×100CVR = \left( \frac{\text{Transactions}}{\text{Sessions}} \right) \times 100
-
Cart-to-Checkout Rate – Percentage of users who proceed from adding items to the checkout page.
-
Checkout-to-Purchase Rate – Percentage of users who complete a purchase after starting checkout.
3. User Engagement Metrics
-
Sessions with Transactions – How many sessions result in a purchase.
-
Engaged Sessions – Sessions where users stay active (scroll, click, or engage for 10+ seconds).
-
Time to Purchase – The time it takes from a user’s first visit to completing a purchase.
4. Shopping Behavior Metrics
-
Add-to-Cart Rate – Percentage of users who add a product to the cart.
-
Cart Abandonment Rate – Percentage of users who add items but do not complete checkout. Formula:
Cart Abandonment Rate=(Add to Carts−Completed PurchasesAdd to Carts)×100\text{Cart Abandonment Rate} = \left( \frac{\text{Add to Carts} – \text{Completed Purchases}}{\text{Add to Carts}} \right) \times 100
-
Product View-to-Purchase Rate – Percentage of users who view a product and complete a purchase.
5. Customer Retention & Lifetime Value
-
Customer Lifetime Value (CLV) – Predicts the total revenue a customer will generate.
-
New vs. Returning Customers – Helps assess customer loyalty and acquisition efforts.
-
Repeat Purchase Rate – Percentage of customers who make multiple purchases.
6. Traffic & Acquisition Metrics
-
Sessions by Traffic Source – Measures which channels (Organic, Paid, Social, Direct) drive the most traffic.
-
Cost per Acquisition (CPA) – The average cost to acquire a paying customer.
-
Return on Ad Spend (ROAS) – Revenue generated per dollar spent on advertising. Formula:
ROAS=Revenue from AdsAd SpendROAS = \frac{\text{Revenue from Ads}}{\text{Ad Spend}}
How to Track These Metrics in GA4?
To track eCommerce metrics in Google Analytics 4 (GA4), you need to set up Enhanced eCommerce tracking and configure reports properly. Here’s a step-by-step guide:
1. Enable Enhanced eCommerce in GA4
GA4 automatically tracks basic purchase events, but for detailed tracking (cart, checkout, refunds, etc.), follow these steps:
A. Enable Enhanced eCommerce in GA4
-
Go to Google Analytics → Admin Panel.
-
Select Data Streams (under “Property” settings).
-
Click on your website’s stream and scroll to Enhanced Measurement.
-
Ensure that “Purchase events” tracking is enabled.
2. Implement eCommerce Tracking Using Google Tag Manager (GTM)
If you’re using Google Tag Manager (GTM), set up GA4 event tracking for eCommerce actions.
A. Set Up GA4 Configuration Tag in GTM
-
Open Google Tag Manager → Click New Tag.
-
Select GA4 Configuration.
-
Enter your GA4 Measurement ID (found in GA4 Admin > Data Streams).
-
Set the trigger to “All Pages” → Save & Publish.
Steps to Create an “Add to Cart” Event in GTM
-
Create a new tag → Choose GA4 Event.
-
Enter “add_to_cart” as the Event Name.
-
Use data layer variables (e.g.,
product_id
,value
,currency
) to pass product details. -
Set the trigger to fire on “Click Add to Cart” event.
-
Save, test using Preview Mode, and publish.
Tip: Follow the same process for other events like purchase
, view_item
, and begin_checkout
.
3. Use GA4 Reports to Analyze eCommerce Data
Once tracking is set up, analyze eCommerce performance using GA4 Reports:
A. Monetization Reports (Prebuilt)
-
Go to GA4 → Reports → Monetization
-
“Overview” – Total revenue, purchases, and items sold.
-
“Ecommerce Purchases” – Revenue by product category.
-
“In-app Purchases” (for mobile apps).
-
B. Create Custom Reports (Explorations)
For deeper insights, create custom Exploration reports:
-
Go to GA4 → Explore → Blank Exploration.
-
Add Dimensions (Event Name, Item Name, Traffic Source).
-
Add Metrics (Revenue, Transactions, Conversion Rate).
-
Use filters like “Event Name = purchase” to focus on specific events.
4. Track Key eCommerce Metrics in GA4
With tracking in place, you can monitor these important metrics in GA4:
Revenue & Conversion Metrics
Total Revenue → GA4 Report: Monetization > Ecommerce Purchases
Conversion Rate → GA4 Report: User Acquisition > Session Conversion Rate
Cart Abandonment Rate → Custom Event Report (Cart Started vs. Completed Purchases)
User Behavior Metrics
Average Order Value (AOV) → Custom Exploration: Revenue / Transactions
Repeat Purchase Rate → Retention Reports
Time to Purchase → Funnel Analysis
5. Bonus: Link GA4 with Google Ads for Better Attribution
-
Go to GA4 → Admin → Google Ads Links.
-
Connect your Google Ads account to GA4.
-
Use Audiences & Custom Reports to analyze which campaigns drive sales.
GA4 is more event-driven than Universal Analytics, so setting up custom events is crucial for detailed eCommerce tracking.
Use Google Tag Manager (GTM) for easier event tracking and Exploration reports for deeper insights.
Link GA4 with Google Ads & BigQuery for advanced data analysis.
Configuring GA4 eCommerce Events
GA4 uses event-based tracking, which means you need to set up specific events to track user actions. The most important eCommerce events include:
Event Name | Description |
---|---|
view_item |
When a user views a product page |
add_to_cart |
When a user adds a product to their cart |
begin_checkout |
When a user starts the checkout process |
purchase |
When a user completes a transaction |
How to Set Up Events in GA4
If you’re using Google Tag Manager, setting up events is straightforward:
- Open Google Tag Manager
- Create a new tag and select GA4 Event
- Name the event (e.g.,
purchase
) - Set up the trigger (e.g., fires when someone reaches the order confirmation page)
- Publish the tag
You can test your event tracking using GA4’s DebugView (found under Admin > DebugView) to make sure everything is working.
Analyzing eCommerce Performance in GA4
Once you’ve set up tracking, it’s time to dive into the data. GA4 offers several powerful reports to analyze your eCommerce performance.
1. Monetization Reports
This is where you’ll find data on revenue, transactions, and product performance. You can access this under Reports > Monetization > Ecommerce Purchases.
2. Funnel & Path Analysis
Want to know where customers drop off? The Funnel and Path Analysis tools help visualize your customer journey, so you can see where users abandon checkout and optimize your funnel accordingly.
3. Exploration Reports
These are customizable reports where you can segment customers, analyze behaviors, and get deeper insights into trends.
Integrating GA4 with Other Tools
GA4 becomes even more powerful when you integrate it with other platforms. Here are a few must-have integrations:
- Google Ads – Track conversions from paid ads
- Google Search Console – Analyze your organic traffic
- BigQuery – Store and analyze raw data (great for large stores)
- eCommerce Platforms – Shopify, WooCommerce, and Magento all support GA4
Advanced GA4 Features for eCommerce
Want to take things up a notch? GA4 offers some next-level tools to improve your eCommerce tracking:
- Predictive Analytics: GA4 can predict which customers are likely to purchase again
- Custom Dimensions & Metrics: Track specific actions unique to your store (e.g., coupon usage)
- Cross-Device Tracking: See how customers interact with your site across multiple devices
Troubleshooting Common GA4 eCommerce Tracking Issues
1. Transactions Not Showing Up
- Make sure the
purchase
event is firing correctly - Check if Google Tag Manager is properly configured
- Look at DebugView to verify the event is being recorded
2. Data Discrepancies Between GA4 & Payment Processor
- GA4 may filter out certain transactions due to bot filtering
- Some payment platforms (like PayPal) may redirect users offsite, causing tracking issues
- Consider adding server-side tracking for better accuracy
3. Duplicate Transactions
- This happens if the
purchase
event fires twice - Use a unique transaction ID to prevent double-counting
Final Thoughts: Why GA4 is a Game-Changer for eCommerce
Google Analytics 4 might take a little effort to set up, but once you have it running, it’s an incredibly powerful tool for tracking sales, understanding customer behavior, and optimizing your store.
If you haven’t switched to GA4 yet, now is the time. The sooner you start collecting data, the better insights you’ll have to grow your business.
So, are you ready to dive into GA4? Let me know in the comments what challenges you’re facing, and I’ll be happy to help!
(Maybe you are also interested: How to use Google Analytics for eCommerce tracking)
FAQs
1. How do I set up eCommerce tracking in GA4?
To set up eCommerce tracking in GA4, follow these steps:
-
Enable Enhanced eCommerce in GA4 (Admin → Data Streams → Enhanced Measurement).
-
Use Google Tag Manager (GTM) to set up tracking for key eCommerce events (
purchase
,add_to_cart
,view_item
, etc.). -
Implement GA4 event parameters (e.g., product name, price, transaction ID) using the data layer.
-
Test using GA4 DebugView to ensure events fire correctly.
-
Analyze Monetization Reports in GA4 to monitor eCommerce performance.
2. What key eCommerce metrics can I track in GA4?
GA4 provides detailed insights into shopping behavior, conversions, and revenue. Key metrics include:
Total Revenue – Tracks total sales revenue.
eCommerce Conversion Rate (CVR) – Measures the percentage of visitors who complete a purchase.
Cart Abandonment Rate – Tracks how many users add items but do not purchase.
Average Order Value (AOV) – Calculates the average amount spent per order.
Customer Lifetime Value (CLV) – Predicts total revenue from a customer.
3. How do I track abandoned carts in GA4?
GA4 does not have a prebuilt cart abandonment report, but you can track it using custom exploration reports:
-
Track cart-related events (
add_to_cart
,begin_checkout
,purchase
). -
Create an Exploration Report with a funnel visualization.
-
Compare users who started checkout vs. those who completed a purchase.
-
Use audiences to retarget abandoned cart users via Google Ads.
4. How do I track which products generate the most revenue?
To analyze product performance, go to:
📍 GA4 → Reports → Monetization → Ecommerce Purchases
-
View revenue by product category and item views vs. purchases.
-
Use custom reports in Explorations to track top-selling products.
-
Link GA4 with Google Ads to optimize ad campaigns based on product sales.
5. Can I use GA4 to track eCommerce across multiple platforms (website + app)?
Yes! GA4 provides cross-platform tracking by combining data from websites and mobile apps into a single property.
-
Ensure your app uses Firebase SDK for GA4 event tracking.
-
Set up consistent event names (e.g.,
purchase
,add_to_cart
) across web & app. -
Use User ID tracking to unify customer journeys across devices.
-
Analyze behavior in GA4 Reports → User Acquisition & Engagement.