WooCommerce gives you a level of control over your checkout that hosted platforms like Shopify simply cannot match. There is no sandboxed pixel, no app-controlled event layer between your store and the tracking code — you own the server, you own the PHP hooks, you own the dataLayer. That control is genuinely useful when everything is configured correctly. It is also the reason WooCommerce GA4 setups break in ways that are harder to diagnose than their Shopify counterparts.
The result is a common pattern: a WooCommerce store installs a GA4 plugin, sees events flowing in DebugView, and assumes tracking is working. Three months later, revenue in GA4 is 40% lower than what the orders database shows, purchase events are double-counting on page refreshes, and item_id is blank on every add_to_cart event. This guide covers the correct setup, the five issues that cause most of those problems, and how to test that everything is actually working.
WooCommerce GA4 Integration Options
There are three ways to connect WooCommerce with GA4. Each has different trade-offs in reliability, implementation complexity, and long-term maintenance overhead.
Option 1: The Official Google Listings & Ads Plugin
Google's official WooCommerce plugin handles the connection between your store and Google's suite of products. For GA4 specifically, it installs the measurement snippet and fires a subset of the standard e-commerce events. For simple stores that only need purchase tracking and do not use variable products, subscriptions, or complex funnel analysis, it is the fastest path to something working.
The limitation is that the plugin's event implementation does not always populate the full item array schema that GA4's e-commerce reports depend on. Specifically, item_variant, item_category, and item_list_name are inconsistently populated across plugin versions. If you need those parameters for your reporting, the plugin will require custom code additions that eliminate the "no code required" advantage it started with.
Option 2: GTM with the WooCommerce dataLayer (Recommended)
WooCommerce has built-in support for pushing e-commerce data to window.dataLayer. When enabled, it pushes structured objects for view_item, add_to_cart, begin_checkout, and purchase using the GA4 e-commerce schema. GTM reads those objects and forwards them to GA4. This approach separates your tracking configuration from your WooCommerce theme and plugin stack, which makes debugging significantly easier and reduces the risk that a plugin update breaks your tracking.
This is the recommended approach for any store that needs reliable attribution data, runs paid campaigns, or wants to use GA4's e-commerce reports in a meaningful way.
Option 3: Third-Party GA4 Plugins
A number of third-party plugins (from vendors including Pixel Your Site, DuracellTomi, and others) handle the WooCommerce-to-GA4 connection. Quality varies significantly between vendors and across plugin versions. Before using any third-party plugin, check specifically whether it uses the GA4 v2 event schema — the gtag('event', 'purchase', { items: [...] }) format with a properly structured items array. Older plugins that predate GA4's enhanced measurement spec will push events that appear in DebugView but do not populate the e-commerce reports correctly.
The 5 Most Common WooCommerce GA4 Tracking Issues
1. Duplicate Purchase Events
This is the most common and most damaging WooCommerce tracking issue. WooCommerce's thank-you page (/checkout/order-received/) fires on every page load. If a customer refreshes the page, shares the URL, or if your hosting configuration serves the page from cache, your tracking fires a second purchase event against the same order. Multiply that across a high-traffic store and your GA4 revenue numbers will consistently exceed your actual orders database.
The correct fix is deduplication via transaction_id. GA4 does not deduplicate purchase events natively — that is a GTM-layer responsibility. The standard approach is to write the transaction_id to a first-party cookie or sessionStorage key on first fire, and check for its presence before allowing the tag to fire again. If the key exists, the GTM tag should not fire.
2. Revenue Reported in the Wrong Currency
GA4 requires a currency parameter on every purchase, add_to_cart, and view_item event. The value must be an ISO 4217 three-letter code matching the currency the value parameter is expressed in. If currency is missing, GA4 falls back to the currency configured in the GA4 property settings. If those do not match — for example, your store charges in GBP but your GA4 property is configured for USD — every reported revenue figure will be wrong by the exchange rate at the time of conversion.
Multi-currency stores face an additional complication: WooCommerce currency-switching plugins serve prices in the display currency, but order totals are often stored in the base currency. Verify which currency value is being pushed to the dataLayer and whether it matches the currency parameter in your GTM tag configuration.
3. Missing Item Parameters on Add-to-Cart Events
GA4's e-commerce reports depend on item-level data — specifically item_id, item_name, and price — on every event that includes an items array. The add_to_cart event is a common place where WooCommerce setups break on this. Many plugin implementations push the event on the click action before the product data has been resolved, or they use the WooCommerce product slug as the ID instead of the numeric product ID, causing mismatches in GA4's item reports.
To verify: open GTM Preview, add a product to your cart, and inspect the add_to_cart event in the Tag Assistant summary. Expand the event data and confirm the items array contains at minimum item_id, item_name, price, and quantity.
4. Cross-Domain Break with External Payment Gateways
WooCommerce supports payment gateways that redirect customers off your domain to complete payment — PayPal Standard is the most common example. When a customer clicks "Pay with PayPal," they leave your domain, complete the transaction on paypal.com, and are redirected back to your thank-you page. GA4 treats the return from paypal.com as a new session, attributing the purchase to a referral from paypal.com rather than to the original marketing channel that drove the customer to your store.
The fix is to configure cross-domain measurement in your GA4 property settings and in your GTM GA4 Configuration tag. Under Admin → Data collection → More tagging settings → Configure your domains, add the payment gateway domains that redirect back to your store. This ensures GA4 recognizes the return visit as a continuation of the original session rather than a new referral.
5. Variable Product Tracking Without item_variant
WooCommerce variable products — products with size, color, or other attribute combinations — require the item_variant parameter to be populated on e-commerce events. Without it, all variants of a product are aggregated under the parent product ID in GA4's item reports, making it impossible to determine which variants actually sell or which are abandoned in cart.
The specific implementation depends on how your store surfaces variant selection. For standard WooCommerce attribute dropdowns, the selected variation data is available in the page's variation object after the customer selects options. Your dataLayer push or GTM tag needs to read this object and map the selected attributes to the item_variant field as a concatenated string (for example, Blue / Large).
Recommended Setup with GTM
WooCommerce's native dataLayer integration is the most reliable foundation for a GTM-based GA4 setup. You need to enable it and then configure GTM to read from it correctly.
Enabling the WooCommerce dataLayer
WooCommerce does not push e-commerce data to the dataLayer by default when GTM is installed via a plugin. Most GTM plugins for WooCommerce (including GTM4WP, the most widely used) include a dedicated WooCommerce integration setting that must be explicitly enabled. In GTM4WP, this is under Settings → Integration → WooCommerce → Enable WooCommerce tracking. Once enabled, the plugin pushes structured ecommerce objects to the dataLayer for checkout steps, the thank-you page, and product list views.
Configuring GTM Variables for E-commerce Data
In GTM, create a Data Layer Variable for each field you need to extract. For the purchase event, the most important variable maps to ecommerce — the entire e-commerce object — which you then use as the event data source in your GA4 Event tag.
Create a GTM trigger on the Custom Event purchase (this matches the dataLayer push name). Then configure a GA4 Event tag with the event name purchase and use the "Send Ecommerce data" option pointing to the Data Layer as the source. GTM will automatically map the items array and transaction fields from the dataLayer object to the GA4 event parameters.
The Purchase Event Schema
The WooCommerce dataLayer push for a purchase event follows this structure. Confirm that your GTM plugin is generating output that matches this schema before building GTM tags against it:
window.dataLayer.push({
event: "purchase",
ecommerce: {
transaction_id: "WC-12345",
value: 79.99,
tax: 8.00,
shipping: 5.99,
currency: "GBP",
items: [
{
item_id: "SKU_12345",
item_name: "Merino Wool Sweater",
item_category: "Clothing",
item_variant: "Navy / Large",
price: 65.99,
quantity: 1
}
]
}
});
The transaction_id should be the WooCommerce order number, and it should be stable — the same order must always push the same transaction_id regardless of how many times the thank-you page loads. This is what enables deduplication.
Testing Your WooCommerce GA4 Setup
Testing GA4 tracking on a live store carries risk — test purchases inflate your revenue data, and test orders need to be refunded or voided. The preferred approach is to use WooCommerce's built-in order simulation capabilities alongside GTM Preview mode and GA4 DebugView, so you can verify the full event flow without creating real orders.
Using GTM Preview Mode
Enable GTM Preview from the GTM workspace, navigate to your store, and walk through the full purchase funnel. At each step, check the Tag Assistant panel for the following:
- The correct Custom Event name fired (e.g.,
add_to_cart,begin_checkout,purchase) - The GA4 Event tag fired on the correct trigger
- The
ecommerceobject in the dataLayer contains the correct fields - The
itemsarray includesitem_id,item_name,price, andquantity
Using GA4 DebugView
With the GA4 DebugView open (Admin → DebugView), complete a test order on your staging environment or using a payment gateway in test mode. In DebugView, verify:
- The
purchaseevent appears exactly once - The event carries
transaction_id,value, andcurrencyas top-level event parameters - Refreshing the thank-you page does not fire a second
purchaseevent (your deduplication is working) - The
currencyvalue matches the currency in your GA4 property settings
DebugView shows events within seconds of them firing, so you get immediate feedback without waiting for GA4's standard 24-to-48 hour processing delay.
Audit your WooCommerce GA4 setup automatically
NiceLookingData's GA4 audit checks for duplicate purchase events, missing item parameters, currency mismatches, and cross-domain configuration gaps — the same issues covered in this guide. Run a free GA4 audit to see what your WooCommerce store is currently missing.
Frequently Asked Questions
Does WooCommerce automatically track GA4 purchases?
Not by default. WooCommerce does not ship with a built-in GA4 integration. You need either the official Google Listings & Ads plugin, a dedicated third-party GA4 plugin, or a manual GTM setup. Even with a plugin installed, "tracking" often means basic event firing is working — it does not guarantee that the full e-commerce parameter schema is populated correctly, which is what GA4's e-commerce reports depend on.
Why is my WooCommerce GA4 revenue wrong?
The three most common causes are duplicate purchase events (the thank-you page firing on every reload), a currency parameter mismatch between what your store charges and what your GA4 property is configured for, and missing or incorrect value parameter formatting. GA4 expects the value field to be a numeric type, not a string — some plugins push it as "79.99" (a string), which causes GA4 to record zero revenue for the event.
How do I stop WooCommerce from firing duplicate purchase events?
Implement deduplication using transaction_id. On the first purchase event fire, write the transaction_id to sessionStorage. Add a GTM Custom JavaScript variable that checks for the key's existence and returns false if it's already present. Use this variable as an additional condition on your purchase tag trigger, so the tag only fires when the variable returns true (meaning the transaction has not been recorded in the current session).
Do I need a plugin to connect WooCommerce with GA4?
No. It is possible to implement GA4 e-commerce tracking entirely through custom PHP added to your theme's functions.php or a custom plugin that hooks into WooCommerce's action hooks. However, this approach requires PHP development work and ongoing maintenance as WooCommerce and GA4 evolve. For most stores, the GTM-plus-plugin approach is more maintainable because it separates tracking configuration from your PHP codebase.
How do I track WooCommerce add to cart in GA4?
With a GTM plugin that supports WooCommerce dataLayer integration, the add_to_cart dataLayer push is handled automatically. In GTM, create a Custom Event trigger matching the event name add_to_cart, then configure a GA4 Event tag with "Send Ecommerce data" pointing to the Data Layer. The items array pushed by WooCommerce should include the product ID, name, and price. Verify in GTM Preview that the items array is not empty and that item_id is populated — this is the most common gap in add-to-cart tracking.
Does GA4 work with WooCommerce Subscriptions?
GA4 does not have a native subscription event type that maps cleanly to WooCommerce Subscriptions' renewal billing model. The initial subscription purchase fires as a standard purchase event. Renewal charges, which are processed server-side by WooCommerce without a browser session, require a server-side implementation — typically using the Measurement Protocol to POST the renewal event directly to GA4's collection endpoint when the WooCommerce subscription renewal order is created. This is a more advanced implementation that goes beyond what any standard plugin handles.
How do I set up GA4 enhanced ecommerce in WooCommerce?
GA4 does not use the term "enhanced ecommerce" — that was a Universal Analytics concept. The GA4 equivalent is the standard e-commerce event set: view_item_list, view_item, add_to_cart, remove_from_cart, view_cart, begin_checkout, add_payment_info, add_shipping_info, and purchase. GTM plugins with WooCommerce integration typically cover the core funnel events. The checkout step events (add_payment_info, add_shipping_info) often require additional configuration depending on your checkout page structure.
What is the WooCommerce dataLayer and how does GA4 use it?
The dataLayer is a JavaScript array that WooCommerce (via a GTM plugin) uses to pass structured data from your server-rendered PHP pages to GTM. When a customer views a product, adds something to cart, or completes a purchase, WooCommerce pushes an object to window.dataLayer containing the relevant transaction data. GTM monitors this array for new pushes, extracts the values you specify via Data Layer Variables, and forwards them to GA4 via the GA4 Event tag. The separation means you configure tracking in GTM rather than in PHP, which is easier to maintain and does not require code deployments to update tag behaviour.
Analytics consultant turned founder. After years running the same GA4 and GTM audits across client engagements, Ludde built the audit into a product — so the pattern-matching takes a minute, not a meeting. More about Ludde →
Run a free GA4 audit.
Connect your Google Analytics 4 property. Our auditor runs 61 checks and gives you an instant health score with a plain-English action plan.