One WooCommerce site I recently checked had 86 purchase events in GA4, but zero revenue and no product data. If I had stopped at the event count, I could easily have said the tracking was working.
It wasn’t. GA4 knew that something called purchase had happened. It did not have the order value or item information needed to make that event useful.
This is how I diagnose WooCommerce Google Analytics problems: establish what already works, find where the order data goes missing, then fix that part. Installing another plugin or creating another purchase tag is not my first step.
Start here: check the purchase payload, not just whether the event fires. This guide covers existing GA4 setups using WooCommerce, Google Tag Manager or Site Kit. The custom PHP example is optional, not a requirement for every shop.
Key takeaways
- WooCommerce purchases showing £0 revenue in GA4 usually means the purchase event is arriving without value, currency or an items array, not that tracking is missing.
- Check what already sends purchase events, such as Site Kit, Google for WooCommerce, GTM or theme code, before adding another tag, so one order is counted once.
- In GTM Preview, inspect the dataLayer at the purchase event itself and confirm transaction_id, value, currency, tax, shipping and items are present.
- Confirm the fix in GA4 DebugView with a test order, then reconcile the transaction ID, items and value against the WooCommerce order.
- For Google Ads, keep one primary purchase conversion action, send the order value and transaction ID, and count every conversion so Target ROAS bids on real revenue.
Why WooCommerce purchases can show £0 revenue in GA4
An event name is a label. A useful ecommerce event also carries a payload: the details sent with it. For a purchase, inspect transaction_id, value, currency and the items array. Tax and shipping should be supplied separately when applicable. Each item should have an ID or name, with its price and quantity for meaningful product reporting.
Missing values are one explanation for £0 revenue, but not the only one. Check the property, date range, currency, filters and processing delay before deciding the implementation is broken. A genuinely free order can also have zero revenue.
What I found on the first site
Alongside those 86 purchase events, the Ecommerce purchases report showed zero items viewed, zero items purchased and zero item revenue. GTM already had a dynamic GA4 ecommerce tag, parameter variables and a trigger covering the shopping events. It was ready to forward data. The missing piece was WooCommerce supplying a useful purchase payload.
After adding the missing order data and testing, DebugView showed a purchase with value: 487.31, a transaction ID, currency, tax, shipping and item details. The item report subsequently began populating. That confirmed the data was arriving. I still checked the value against the order.
That fix did not recreate the missing historical revenue. It also did not automatically fix product views: Items viewed depends on view_item, not the purchase event.
Which GA4 ecommerce events should WooCommerce track?
Track the stages your shop actually supports. Google’s ecommerce implementation guide describes the event sequence. A plugin may implement some stages but not all of them.
| Event | What it measures |
|---|---|
view_item_list / select_item | Products shown in a list / a product selected from it. |
view_item | A product detail view. |
add_to_cart / remove_from_cart | Items added to or removed from the basket. |
view_cart / begin_checkout | Basket viewing / checkout starting. |
add_shipping_info / add_payment_info | Shipping or payment information submitted at the relevant step. |
purchase | The purchase, with transaction and product information. |
refund | A refund linked to its transaction, with items where relevant. |
A purchase-only fix does not implement this whole funnel, subscriptions or refunds. Do not create extra events purely to fill every row of a report.
How to check whether WooCommerce Google Analytics tracking is working
1. Check GA4 events and item reporting
In GA4, open the Events report and find purchase. Then open Reports → Monetisation → Ecommerce purchases. If it isn’t there, use the report search.
Check Item name, Items purchased and Item revenue. Check purchase revenue or total revenue separately in Monetisation overview or a relevant report. It isn’t the same as item revenue. See Google’s Ecommerce purchases report explanation.
Use the same date range and property when comparing reports. Pick one test order you can trace rather than trying to reconcile a month’s totals immediately.
2. Follow the journey in Tag Assistant
Open the relevant GTM container, select Preview and connect to your shop. View a product, add it to the basket and start checkout. Inspect the event stream for view_item, add_to_cart, view_cart and begin_checkout.
Select an event and inspect its Data Layer, Variables and fired tags. Does it contain products, prices, quantities, currency and value? Check the values at that event, not just the latest values after navigating elsewhere. A dataLayer push doesn’t prove GA4 received anything.
What the second site taught me
On another shop, add_to_cart already contained GBP currency, value, item ID, name, price, quantity and categories. The source information pointed to Site Kit and WooCommerce. The whole ecommerce setup was not broken.
The purchase-related GTM tag was different. Its event name was order_pageview, triggered by an order-page visit, with no ecommerce parameters. It could report that someone saw a confirmation page. It could not tell GA4 what they bought.
Renaming that event to purchase alone would not supply the missing data. I needed to inspect the purchase stage and the existing sender before adding anything.
How to fix the GA4 purchase event in WooCommerce
Check Site Kit and existing plugins first
Inventory what can send analytics: Site Kit, Google for WooCommerce, Google Analytics integrations, GTM, direct Google tags and custom code. Note the destination measurement ID for each. Two tools can coexist legitimately, but they should not unknowingly send the same purchase to the same destination.
For Site Kit, look under Settings → Connected Services → Analytics → Edit → Plugin conversion tracking. Google’s Site Kit documentation lists WooCommerce as supported. Do not switch that setting off across the site without checking what other events rely on it.
If you see markers such as event_source = site-kit or googlesitekit_event_provider = woocommerce, they’re useful clues about which tool sent the event. Not every install will have them. Also check whether logged-in users are excluded before testing as an administrator.
Check your GTM tags and triggers
Search Tags for purchase, ecommerce, GA4, order and WooCommerce. Open each relevant tag and record its event name, destination, parameters and trigger. Look for dynamic event names and existing ecommerce Data Layer Variables.
If a suitable tag already exists, test whether its variables are populated. A correctly configured tag receiving undefined values usually needs an upstream fix, not a duplicate tag.
Inspect the active child theme only when necessary
On my first site, I inspected the active child theme’s functions.php before adding code. Search existing code and snippet plugins for purchase, dataLayer, gtag and woocommerce_thankyou. Custom integrations may live outside the theme.
Where enabled, the WordPress route is Appearance → Theme File Editor → active child theme → functions.php. The file you need is not style.css. A child theme protects changes from parent-theme updates, but tracking tied to a theme stops running if you change themes. A maintained integration or a small site-specific plugin may be more suitable long term.
Before editing PHP: take a backup, work on staging and have a way to restore the file outside WordPress. A syntax error can break the site. Do not enable a disabled file editor just for this guide; use your developer’s normal deployment process. See WordPress’s editor guidance.
Push WooCommerce purchase data to the dataLayer
The example below reads WooCommerce order objects, not prices scraped from the page. It supplies a purchase payload for an existing GTM integration to consume. It does not install GA4 or implement consent controls.
Scope: this is a starting example for a standard order-received page that executes woocommerce_thankyou. Confirm that your actual checkout and confirmation template run that hook, especially with Blocks or checkout extensions. The hook exists in WooCommerce’s thank-you template.
The example only runs for an order WooCommerce considers paid and a matching order key. is_paid() is status-based, not an independent bank settlement check. Review cash-on-delivery behaviour. Pending bank transfers, delayed payment confirmation, subscription renewals and shoppers who never return to the thank-you page need another approach.
Show the optional PHP purchase example
Paste into an existing PHP context, outside other functions, before any closing PHP tag. Do not add a second opening <?php tag. Preserve unrelated code.
// Example for a standard thank-you page. Test on staging first.
add_action( 'woocommerce_thankyou', 'rf_ga4_purchase_datalayer', 20 );
function rf_ga4_purchase_datalayer( $order_id ) {
if ( ! function_exists( 'wc_get_order' ) || ! is_order_received_page() ) {
return;
}
$order = wc_get_order( absint( $order_id ) );
// Status-based paid check: review your payment gateways and COD policy.
if ( ! $order || ! $order->is_paid() ) {
return;
}
$key = isset( $_GET['key'] ) && is_string( $_GET['key'] )
? wc_clean( wp_unslash( $_GET['key'] ) ) : '';
if ( ! $key || ! hash_equals( $order->get_order_key(), $key ) ) {
return;
}
$items = array();
$value = 0.0;
foreach ( $order->get_items( 'line_item' ) as $item ) {
$quantity = (float) $item->get_quantity();
if ( $quantity <= 0 ) {
continue;
}
$product = $item->get_product();
$sku = $product ? $product->get_sku() : '';
$product_id = $item->get_variation_id() ?: $item->get_product_id();
// Discounted line total, excluding tax. Not today's catalogue price.
$line_total = (float) $item->get_total();
$items[] = array(
'item_id' => (string) ( $sku !== '' ? $sku : $product_id ),
'item_name' => wp_strip_all_tags( $item->get_name() ),
'price' => $line_total / $quantity,
'quantity' => $quantity,
);
$value += $line_total;
}
if ( ! $items ) {
return;
}
$payload = array(
'event' => 'purchase',
'ecommerce' => array(
'transaction_id' => (string) $order->get_id(),
'value' => (float) wc_format_decimal( $value, wc_get_price_decimals() ),
'currency' => $order->get_currency(),
'tax' => (float) $order->get_total_tax(),
'shipping' => (float) $order->get_shipping_total(),
'items' => $items,
),
);
$json = wp_json_encode(
$payload,
JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT
);
if ( false === $json ) {
return;
}
// Guard repeated callbacks in this document only; not a delivery receipt.
echo '<script>(function(p){'
. 'var id=p.ecommerce.transaction_id;'
. 'window.rfGa4Orders=window.rfGa4Orders||{};'
. 'if(window.rfGa4Orders[id])return;'
. 'window.rfGa4Orders[id]=true;'
. 'window.dataLayer=window.dataLayer||[];'
. 'window.dataLayer.push({ecommerce:null});'
. 'window.dataLayer.push(p);'
. '})(' . $json . ');</script>';
}
The function uses WooCommerce’s order methods and order-item methods. The line total reflects the order’s discount, rather than today’s catalogue price. Dividing it by quantity gives the discounted unit price. SKU is used when available, otherwise the variation or product ID.
Which value should you send? (float) $order->get_total() is the full WooCommerce order total, which may include tax, shipping and fees. Google’s purchase specification defines value as the sum of item price × quantity, excluding shipping and tax. This example follows that convention and does not include order-level fees in item revenue. Document any different business definition instead of quietly mixing the two.
For example, two items at £60 each give value: 120. With £24 tax and £5 shipping, the customer pays £149. Sending 149 as the item subtotal would make those figures disagree.
Test coupons, rounding, variations, deleted products, fees and large baskets. Review customised product names to ensure they cannot contain customer details. Do not send names, email addresses, delivery addresses or order keys to GA4. Review automatically collected page URLs too, so a confirmation-page order key is not inadvertently included.
Create GTM variables and a purchase trigger if required
If the current tag already consumes this event, reuse it. Otherwise, under Variables, create Data Layer Variables, Version 2, using the exact paths below. The friendly names are your choice; these paths are not.
| GA4 parameter | Data Layer Variable name |
|---|---|
| items | ecommerce.items |
| transaction_id | ecommerce.transaction_id |
| value | ecommerce.value |
| currency | ecommerce.currency |
| tax | ecommerce.tax |
| shipping | ecommerce.shipping |
Create a Custom Event trigger whose event name is exactly purchase. Configure a Google Analytics: GA4 Event tag for the existing Google tag/measurement ID, set its event name to purchase, and map each parameter to the matching variable. Choose the variables from GTM; do not enter their names as plain text.
Google also documents a Send Ecommerce data option. Use one consistent configuration rather than combining competing mappings. Check the official GTM ecommerce setup, preview the event and publish the GTM version only after verification.
How to avoid duplicate WooCommerce purchase tracking
Choose which system owns the purchase event. Possible senders include Site Kit, Google for WooCommerce, analytics plugins, Google Analytics Pro, GTM, theme code, direct gtag code and thank-you-page conversion tags. Check for multiple containers as well.
The objective is one real order producing one valid purchase, with a stable transaction ID and matching products and value. Check both the tags that fired and the events GA4 received. One GTM tag doesn’t rule out a second sender elsewhere.
GA4 uses transaction_id to help deduplicate purchases, but don’t rely on it to tidy up a messy setup. Never generate a fresh transaction ID on reload or reuse a blank/shared ID. The example’s JavaScript guard only prevents repeated callbacks in the same document. Refreshing or revisiting can send again.
Do not mark an order permanently “tracked” in PHP merely because the page rendered. That cannot prove a browser sent the event or that GA4 accepted it. Consent choices, blocked requests and closed tabs still matter. Reliable delayed-payment or server-side tracking needs its own delivery and deduplication design.
How to test WooCommerce purchase tracking
Test an actual checkout journey
Use a staging shop, test GA4 property and your gateway’s sandbox where possible. Follow WooCommerce’s test-order guidance. Do not switch a live gateway into test mode while customers are shopping.
- Connect Tag Assistant and record the destination measurement ID.
- Make the appropriate consent choice for the test and inspect tag consent behaviour.
- Place a test order, including a discounted product and quantity greater than one.
- Find purchase in Tag Assistant. Check the payload and resolved tag parameters.
- Match transaction ID, items, currency, tax, shipping and the chosen value definition against WooCommerce.
- Verify receipt in GA4 DebugView, then check a failed or unpaid order does not masquerade as a paid sale.
- Refresh the confirmation page and inspect repeat sends. Test both guest and signed-in checkout where supported.
Test with and without consent using your site’s intended configuration. A missing event under denied consent can be correct behaviour. A plugin may exclude administrators, and a developer-traffic filter can keep debug events out of standard reports.
Using an existing order-received page
Typing /checkout/order-received/27163/ is not a reliable test. A valid confirmation link normally includes an order key, for example ?key=wc_order_XXXXXXXX. Your checkout path may differ. The WordPress order-edit screen is not the customer’s confirmation page.
WooCommerce can generate the correct address with $order->get_checkout_order_received_url(). This temporary administrator-only helper adds a button to the standard order details screen. Use a test order, keep the link private and remove the helper afterwards.
Show the temporary order-page button example
// Temporary administrator-only helper. Remove after testing.
add_action( 'woocommerce_admin_order_data_after_order_details', 'rf_test_order_link' );
function rf_test_order_link( $order ) {
if ( ! current_user_can( 'manage_options' ) || ! $order instanceof WC_Order ) {
return;
}
printf(
'<p><a class="button" href="%s" target="_blank" rel="noopener noreferrer">Open Order Received Page</a></p>',
esc_url( $order->get_checkout_order_received_url() )
);
}
Reopening an old order can resend tracking. It tests what that page emits now, not whether the original payment journey was measured. It can contaminate production data, and user exclusion may stop it recording altogether. Do not replay historical customer orders to try to repair old reports.
How to use ChatGPT to diagnose WooCommerce GA4 tracking
“How do I add GA4 to WooCommerce?” is too broad when half the setup already works. It can lead to instructions for a second implementation when you only need to repair one event.
Give ChatGPT evidence in stages: the GA4 event count and item report, Tag Assistant events, relevant GTM tags and triggers, the plugin list and Site Kit settings. If code needs inspection, provide the relevant functions.php content before changing it.
Remove client names, customer information, credentials, order keys and private URLs first. Include event names, anonymised values, plugin versions, checkout type and payment status. Paste code as text, not screenshots.
Copy this diagnostic prompt
I'm troubleshooting GA4 ecommerce tracking on a WordPress WooCommerce website.
Diagnose the existing implementation first. Do not immediately suggest another plugin or purchase tag. Avoid duplicate tracking.
I will provide redacted screenshots or code from GA4 Events, Ecommerce purchases, GTM tags and triggers, Tag Assistant, WordPress plugins, Site Kit settings and, if needed, the active child theme's functions.php.
First establish which events work: view_item, add_to_cart, begin_checkout and purchase. Identify the sender and GA4 destination for each. Distinguish a dataLayer event from a tag firing and GA4 receiving it.
For purchase, inspect transaction_id, value, currency, tax, shipping and items. Check item_id/item_name, price and quantity. Reconcile the value definition with the WooCommerce order, discounts, tax and shipping.
Inspect existing code before suggesting edits. Look for GA4, GTM, purchase, dataLayer and woocommerce_thankyou. Preserve unrelated functions. If custom code is needed, use WooCommerce order APIs, verify current official documentation and explain checkout, payment-status, consent and duplicate-event limitations.
Tell me exactly where a change belongs and how to test it on staging. Check syntax from code text, not just screenshots. Do not claim it works before testing.
After the change I will provide GTM Preview and GA4 DebugView evidence. Confirm the order ID, value, currency and products, then check refreshes, failed payments and the correct GA4 destination. Tell me what remains unverified.After any change, give it the new purchase payload and DebugView event and ask it to explain any differences. It’s good at comparing evidence, but you still need a backup and a real checkout test.
How to verify revenue and product data in GA4 DebugView
Enable debug mode for your test device through Tag Assistant. In GA4, go to Admin → Data display → DebugView, select your device and open purchase. Google’s DebugView instructions explain the current controls.
Check transaction_id, value and currency, plus tax and shipping where supplied. Open Items and inspect ID/name, price and quantity. Compare the received values with the resolved GTM tag. If the dataLayer is correct but DebugView is not, investigate the mapping, destination and consent behaviour.
How long does WooCommerce revenue take to appear in GA4?
Use DebugView for immediate troubleshooting, not the standard item report. Google says report processing can take 24 to 48 hours.
If a fresh event looks correct, allow processing time and check filters, date range and property timezone. If value or items are absent in the event itself, waiting will not supply them. A tracking repair also does not retrospectively populate missing information in previously collected events.
WooCommerce GA4 troubleshooting checklist
| What you see | What to check next |
|---|---|
| Purchase events, £0 revenue | Value, currency and their types; then free orders, filters and processing. |
| Purchases, but no products | Missing or malformed items array and the tag’s items mapping. |
| Add to basket works, purchase does not | The purchase sender, payment status and actual confirmation template. |
| Two sends for one order | Competing plugins/tags, multiple containers and page revisits. |
| Bare order-received URL does nothing | Use the generated test-order URL with its key; check access requirements. |
| GTM sees purchase, GA4 does not | Tag firing, measurement ID, consent, blocked requests and debug setup. |
| DebugView correct, reports blank | Processing, developer/internal filters, report scope and date range. |
Before signing off, confirm one traced order, the correct property, a stable transaction ID, reconciled value and item data, ownership of the purchase event, and the behaviour on refresh, failed payment and consent changes.
Why this matters for Google Ads
This is the part I care about most. If Google Ads is bidding on purchases, the value you send is the value it optimises towards. With £0 or a flat value, Target ROAS and Maximise conversion value can’t tell a £20 order from a £2,000 one.
Once GA4 is right, check the Google Ads side:
- Pick one source of truth. You can track purchases with the Google Ads tag or import the GA4 purchase key event. Both work. Running both as primary actions counts each sale twice and inflates ROAS, so keep one primary and set the other to secondary.
- Use transaction-specific values. Set the action to use different values for each conversion, using the same value definition you chose for GA4.
- Send the transaction ID. Google Ads uses it to stop the same order being counted twice.
- Count every conversion. Each order is worth money, so purchase actions should count every conversion, not one per click.
- Give bidding time to adjust. Correcting values changes what the bid strategy learns from. Don’t judge ROAS on the first few days after the fix.
For more on how actions and goals fit together, see my guide to Google Ads conversion actions. Enhanced conversions can improve how many sales Google Ads can match to a click, but it won’t fix a missing value or items array. That has to be right first.
Common questions
Do I need a WooCommerce Google Analytics plugin?
Not necessarily. A maintained plugin can handle the integration, but an existing Site Kit or GTM setup may already cover it. Check what sends data before choosing another method.
Does Site Kit track WooCommerce purchases?
Site Kit supports WooCommerce through plugin conversion tracking. Verify the setting and the purchase payload on your own shop, including whether your test user is excluded.
Can I test a WooCommerce purchase without paying?
Use a payment gateway’s sandbox on staging. A zero-cost order tests a different value case, and an unpaid bank-transfer order will not pass this example’s paid-status check. Test the payment journey your customers actually use.
Will this PHP fix all GA4 ecommerce events?
No. It illustrates a purchase payload on a supported confirmation page. Product views, baskets, refunds, delayed payments and renewals need their own coverage.
Need a second pair of eyes?
Once purchase tracking is reliable, the next question is where customers leave the buying journey. My ecommerce conversion review support covers product pages, mobile usability and checkout obstacles, alongside measurement.
If your WooCommerce site records conversions but the numbers do not look right, I can review the setup and help work out what is actually reaching GA4 and Google Ads. I can help with the fix, work alongside your team or show you how to manage the tracking yourself.
Written by Michael at Results First. Technical sources checked October 2026. Case studies are anonymised; walkthrough visuals use clearly labelled example data.








