E-commerce

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.

Jordan Andreev 10 min read

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

Product viewedview_item
Added to cartadd_to_cart
Cart viewedview_cart
Checkout startedbegin_checkout
Shipping selectedadd_shipping_info
Payment selectedadd_payment_info
Purchasepurchase

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.

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

  1. DebugView (Admin › DebugView) – place a test order and check that every event fires in the right order, with products and value.
  2. Compare with WooCommerce – after a week, compare order count and revenue. A few percent difference is normal; 30% isn't.
  3. 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.
  4. Duplicate purchases – if a customer reloads the thank-you page, the purchase shouldn't count again. Good plugins prevent this using transaction_id.
  5. 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

Is Google Analytics 4 free?
Yes, the standard version of GA4 is free and more than enough for small and mid-sized online stores. The paid version (GA4 360) is for very large sites with huge traffic.
Why doesn't GA4 revenue match WooCommerce?
A difference of a few percent is normal – ad blockers, declined cookie consent, cancelled cash-on-delivery orders. If the gap is large, check for duplicate purchases when the thank-you page is reloaded and for sessions lost when customers return from the payment site.
Do I need a cookie banner to use GA4?
Yes. In the EU, analytics cookies require visitor consent. Use a banner that supports Google Consent Mode v2 and run GA4 according to the visitor’s choice.
Plugin or Google Tag Manager?
For most stores the official plugin is enough and takes minutes to set up. Google Tag Manager is more flexible when you run several pixels (Meta, Google Ads, TikTok) and want everything in one place.
How long does GA4 keep data?
Detailed exploration data is kept for only 2 months by default. You can raise it to 14 months in the property settings – do it right after creating the property.

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
Jordan Andreev

Author:

Web developer specialising in WordPress and WooCommerce. I build fast, secure and SEO-optimised online stores.

Esc
↑↓↵EscJ.Andreev