WooCommerce7 min read9 views

WooCommerce GA4 purchase tracking with GTM

Set up WooCommerce GA4 purchase tracking in GTM using order data, correct revenue parameters and checks for duplicate transactions.

Watch on YouTube

The short answer

Track WooCommerce purchases in GA4 by sending an order-backed purchase event through a GTM GA4 Event tag. Google uses transaction_id to deduplicate purchases in web streams, so each order needs its own stable identifier. This guide is for store owners and implementers who already have GTM and a WooCommerce data layer.

  • If a plugin already sends GA4 purchases, inspect its events before adding another tag.
  • Use purchase as the GA4 event name, with order data available when the trigger fires.
  • Google's purchase example sends item-based value, tax and shipping as separate parameters.
  • Steps and settings checked against Google and WooCommerce documentation on 25 October 2026.

Ask an assistant

ChatGPTClaudePerplexity

FREE CALL

30 MIN

Meta stopped counting your leads? Get them counted again.

  1. Pick a time
  2. Check your Meta account with Hassan
  3. See what to do next

On a free 30-minute call, Hassan checks your Meta account with you and shows you what to do next.

Book my free recovery callFree 30-minute call with Hassan.

Not ready to talk? Run a free check

What does GA4 need to record a WooCommerce purchase?

GA4 needs the purchase event and its ecommerce data, not just a visit to an order-received page. Google's ecommerce guidedevelopers.google.com sends purchase with an order ID, currency, value and an items array.

This is the purchase step in the WooCommerce series. If you cannot yet see store events in GTM, start with the WooCommerce data layer and GTM setup. The video shows the older GA4 Configuration method; use the current written steps and Google tag instructions below.

When is another GTM purchase tag the wrong fix?

Do not add another sender when your existing plugin already sends the correct purchases. The Google Analytics for WooCommerce extensionwoocommerce.com can send purchase transactions itself; installing it is not the same job as exposing ecommerce data to GTM.

This guide assumes your data-layer integration already exposes completed-order data. It does not implement WooCommerce payment-status handling. If your purchase payload is missing, or marks an unpaid order as purchased, fix that integration before configuring a GA4 tag.

Check the payment methods you actually offer. WooCommerce's extension documentation notes that its purchase tracking requires a gateway that returns the buyer to the thank-you/order-received page. A GTM trigger cannot recover data from a browser visit that never happens.

How do I check the order data before making a tag?

Place a test order in GTM Preview and inspect the event that carries its ecommerce object. Use that event's actual name for the trigger; plugins do not all have to use the same name.

1. Inspect a completed test order

  1. Open Preview.
  2. Connect to the store.
  3. Complete a test checkout as a shopper.
  4. At the purchase data-layer event, inspect the order fields in the table below.

transaction_id

Data layer path for this guide
ecommerce.transaction_id
Check against the order
A non-empty order identifier, stable when revisiting this order

currency

Data layer path for this guide
ecommerce.currency
Check against the order
The currency used for the recorded item values

value

Data layer path for this guide
ecommerce.value
Check against the order
The purchase amount calculated by your integration; check its definition against the example below

tax

Data layer path for this guide
ecommerce.tax
Check against the order
Tax amount, sent separately when available

shipping

Data layer path for this guide
ecommerce.shipping
Check against the order
Shipping amount, sent separately when available

items

Data layer path for this guide
ecommerce.items
Check against the order
An array with the purchased products, prices and quantities
Use these paths only if they match the payload your WooCommerce integration produces.

Stop if the fields are missing or still contain the previous cart's values.

Done when the order ID, amounts and products match the completed test order.

Google's purchase exampledevelopers.google.com sets value to the sum of item price times quantity and sends tax and shipping as separate parameters. If your integration uses another structure, map its real fields to these parameter names rather than renaming data blindly.

How do I configure the GA4 purchase tag in GTM?

Use a GA4 Event tag with the name purchase, connected to the existing GA4 web stream. Google's event setup guidesupport.google.com distinguishes this event tag from the tag that initializes Analytics.

2. Confirm the Google tag

Google's current setup guidesupport.google.com documents the Google Analytics destination and the alternate Google tag setup.

  1. Find the store's GA4 measurement ID.
  2. Confirm the base tag points to that stream.
  3. Reuse the existing working configuration.

Done when the base tag's configured destination matches the store's GA4 web stream and Preview shows the Google tag firingsupport.google.com.

3. Create the variables and purchase trigger

  1. Create Data Layer Variablessupport.google.com, which read values from the data layer, for the paths in the table.
  2. Use Version 2 for nested fields.
  3. Give them names such as DLV - Purchase value and DLV - Transaction ID.
  4. Create a Custom Event trigger, the condition that tells GTM when to run the tag.
  5. Enter the event name observed in Preview. If the data layer says purchase, enter purchase.
  6. Leave regular-expression matching off.
  7. Keep the trigger tied to the completed-order event.

A button click or a thank-you URL match does not itself supply the order payload.

Done when the trigger's saved event name matches your test and the variables resolve to that order's fields in Previewsupport.google.com.

4. Add the GA4 Event tag

  1. Create Google Analytics: GA4 Event.
  2. Enter the intended Measurement ID.
  3. Set Event Name to purchase.
  4. In Event Parameters, add each parameter in the table.
  5. For each parameter, select its corresponding Data Layer Variable.
  6. Attach your Custom Event trigger.
  7. Save the tag.

items must remain an array, not a text label.

Done when Previewsupport.google.com shows this GA4 Event tag firing on the completed-order event with the mapped parameter values.

How do I prove the tag sends the correct purchase?

Compare a test order with both the fired tag and the event received by GA4. Google's purchase tutorialdevelopers.google.com uses DebugView to inspect event parameters and items.

5. Test the order, revisit and next order

  1. In Preview, complete a test order with tracking consent granted.
  2. Select the purchase event.
  3. Confirm the GA4 Event tag fired with the expected measurement ID and field values.
  4. Open GA4 DebugView with debug mode enabled for the test session.
  5. Open purchase and compare transaction_id, currency, value and items with the store order.
  6. Revisit the order-received page.
  7. Check whether another event is sent and whether it keeps the same transaction ID.
  8. Place a different test order and confirm its ID differs.
  9. Test each payment route.
  10. Test the denied-consent path.
  11. Record what the installation is expected to send under each choice before treating missing events as a tag failure.
  12. Save the order IDs and observed event values with your test notes.

Done when the notes show which payment and consent paths you checked and any differences that still need fixing.

Google says purchase data becomes available in reports after about 24 hoursdevelopers.google.com. Use DebugView for the immediate check; an empty report immediately after setup is not a reason to create another tag.

Which mistakes cause missing or misleading purchase revenue?

Check transaction IDs, value definitions and duplicate senders before changing the trigger. These are different failures and need different fixes.

  • Reusing an empty or constant transaction_id can undercount orders. Google's deduplication guidancesupport.google.com says IDs must be unique per order; keep the same ID only for the same transaction.
  • Comparing a tax-inclusive order total with the item-based value in Google's purchase exampledevelopers.google.com creates an apparent mismatch. Check how your integration calculates value before comparing amounts.
  • Running plugin tracking and a GTM purchase tag for the same stream makes diagnosis harder. Identify the owner of each request and keep one deliberate implementation.

What else affects GA4 purchase reporting?

Can I use a customer email address as the transaction ID?

No. Google's transaction-ID instructionssupport.google.com say to omit information that identifies individual customers. Use the store's unique order identifier instead.

Will refunding an order automatically send a GA4 refund?

Not through the purchase tag configured here. Google documents a separate refund eventdevelopers.google.com with the original transaction ID; check whether your WooCommerce integration sends it before assuming refunds are included in analytics.

What changed in this guide

  • 25 October 2026: Replaced the GA4 Configuration purchase instruction with a GA4 Event tag, added order-data mappings, and clarified duplicate IDs, payment returns, testing and refunds.

Sources

9 sources
  1. 1Google's ecommerce guide↩
  2. 2Google Analytics for WooCommerce extension↩
  3. 3Google's data-layer guide↩
  4. 4Google's event setup guide↩
  5. 5Google's current setup guide↩
  6. 6Preview shows the Google tag firing↩
  7. 7Data Layer Variables↩
  8. 8Google's purchase tutorial↩
  9. 9Google's deduplication guidance↩