Google Analytics 4 for WooCommerce: How to Track Sales and Abandoned Carts
How to set up Google Analytics 4 for a WooCommerce store: ecommerce events, cookie consent, checking your data and the reports that show where you lose customers.
Without tracking you don't know where buyers come from, which products get viewed but not bought, or at which checkout step customers give up. Google Analytics 4 answers these questions for free – if it's set up properly. In many stores GA4 is "installed" but only counts visits, without a single sale.
In short: Connect GA4 to WooCommerce with a plugin or Google Tag Manager so that ecommerce events are sent (from product view to purchase). Add a cookie banner with Consent Mode v2, check the data in DebugView and watch your checkout funnel.
What an online store should track
The basic GA4 tag only counts visits and pages. A store needs ecommerce events – standard names Google understands and uses to build its reports automatically:
The key ecommerce events
Each event also carries product data – name, ID, category, price, quantity – and the purchase adds the order number (transaction_id), value, shipping and currency. Without these, the product and revenue reports stay empty.
How to connect GA4 to WooCommerce
Option 1: the official plugin
The free Google Analytics for WooCommerce extension sends ecommerce events automatically. You enter your measurement ID (G-XXXXXXX), choose what to track and you're done. A good fit for most small and mid-sized stores.
Option 2: Google Tag Manager
A plugin like GTM4WP pushes product and order data into the dataLayer, and in Google Tag Manager you route it to GA4. More work up front, but more flexibility: you manage GA4, Google Ads, the Meta pixel and others in one place without touching the site's code.
Whichever you choose – use only one. The most common mistake is GA4 installed twice (by the theme and by a plugin), so every purchase is counted double.
Cookies and Consent Mode v2
In the EU, analytics cookies require consent. Add a cookie banner that supports Google Consent Mode v2 – since March 2024 Google requires it for visitors from the EEA if you use the data for ads and remarketing. GA4 then follows the visitor's choice, and when consent is declined Google fills in part of the data with modelling. See also the pages every online store must have, including the cookie policy.
Check your data before you trust it
- DebugView (Admin › DebugView) – place a test order and check that every event fires in the right order, with products and value.
- Compare with WooCommerce – after a week, compare order count and revenue. A few percent difference is normal; 30% isn't.
- Unwanted referrals – if customers pay on the bank's or payment provider's page, the purchase can be credited to that site instead of Google or Facebook when they return. Add payment domains under "List unwanted referrals" in your data stream settings.
- Duplicate purchases – if a customer reloads the thank-you page, the purchase shouldn't count again. Good plugins prevent this using
transaction_id. - Data retention – raise it from 2 to 14 months (Admin › Data collection and modification › Data retention).
The reports you actually need
- Ecommerce purchases (Monetization) – which products are viewed, added to cart and bought. A product with many views and few purchases signals a problem with price, photos or description.
- Checkout funnel (Explore › Funnel exploration) – the steps view_item → add_to_cart → begin_checkout → add_shipping_info → purchase. This shows exactly where you lose people and where to start fixing abandoned carts.
- Traffic acquisition – which channels bring not just visits but sales: Google, social, email, ads.
- Devices – if mobile is 70% of traffic but 30% of purchases, your mobile checkout needs work.
💡 From practice: In markets with lots of cash on delivery, like Bulgaria, revenue data gets skewed – GA4 records the purchase when the order is placed, but some parcels are never collected. Track the uncollected rate separately in WooCommerce, or send a refund event for refused orders, so you see real revenue.
Frequently asked questions
Not sure GA4 in your store is tracking correctly? Get in touch – I'll check the setup and show you where you're losing customers.
Need an online store?
Describe your project and get a detailed quote within 24 hours.
Request a quote