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.
Shahzada Ali Hassan, founder of Crisperchecked against 9 sources
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
purchaseas 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.
FREE CALL
30 MINMeta stopped counting your leads? Get them counted again.
- Pick a time
Check your Meta account with Hassan- 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.
Not ready to talk? Run a free check
01What 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.
02When 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.
03How 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
- Open Preview.
- Connect to the store.
- Complete a test checkout as a shopper.
- 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
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.
04How 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.
- Find the store's GA4 measurement ID.
- Confirm the base tag points to that stream.
- 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
- Create Data Layer Variablessupport.google.com, which read values from the data layer, for the paths in the table.
- Use Version 2 for nested fields.
- Give them names such as DLV - Purchase value and DLV - Transaction ID.
- Create a Custom Event trigger, the condition that tells GTM when to run the tag.
- Enter the event name observed in Preview. If the data layer says purchase, enter purchase.
- Leave regular-expression matching off.
- 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
- Create Google Analytics: GA4 Event.
- Enter the intended Measurement ID.
- Set Event Name to
purchase. - In Event Parameters, add each parameter in the table.
- For each parameter, select its corresponding Data Layer Variable.
- Attach your Custom Event trigger.
- 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.
05How 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
- In Preview, complete a test order with tracking consent granted.
- Select the purchase event.
- Confirm the GA4 Event tag fired with the expected measurement ID and field values.
- Open GA4 DebugView with debug mode enabled for the test session.
- Open purchase and compare transaction_id, currency, value and items with the store order.
- Revisit the order-received page.
- Check whether another event is sent and whether it keeps the same transaction ID.
- Place a different test order and confirm its ID differs.
- Test each payment route.
- Test the denied-consent path.
- Record what the installation is expected to send under each choice before treating missing events as a tag failure.
- 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.
06Which 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.
07What 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.
08What 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
- 1Google's ecommerce guidedevelopers.google.com↩
- 2Google Analytics for WooCommerce extensionwoocommerce.com↩
- 3Google's data-layer guidedevelopers.google.com↩
- 4Google's event setup guidesupport.google.com↩
- 5Google's current setup guidesupport.google.com↩
- 6Preview shows the Google tag firingsupport.google.com↩
- 7Data Layer Variablessupport.google.com↩
- 8Google's purchase tutorialdevelopers.google.com↩
- 9Google's deduplication guidancesupport.google.com↩


