WooCommerce Google Ads purchase tracking with GTM
Configure WooCommerce Google Ads purchases in GTM with order values, currency, stable transaction IDs and checks for duplicate conversions.
Shahzada Ali Hassan, founder of Crisperchecked against 13 sources
The short answer
Track WooCommerce purchases with a Google Ads conversion tag using GTM4WP's order event, amount, currency and transaction ID. Google uses matching transaction IDs to reject duplicate conversions for the same actionsupport.google.com. This guide is for store owners and implementers who need to compare a test order with the tag payload.
- Use
purchasewith order data, not an All Pages trigger. - Keep the transaction ID stable for the same order.
- Check GTM4WP tax and shipping settings before comparing revenue.
- Steps and settings checked against Google and GTM4WP 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 do I need before tracking WooCommerce purchases?
Use a staging store, GTM4WP, its GTM web container and the intended Google Ads purchase action. Record any plugin, direct tag or imported analytics action already measuring sales. Another sender is the wrong fix if the existing one works.
The video shows the older configuration; follow the written steps for the current tag fields and tests. If the container is missing, start with the WooCommerce Google Ads installation guide.
1. Record the order test
- Select a test payment route.
- Record the order amount definition you want to send.
Done when your notes name the container, Ads purchase action, existing sender and test gateway.
02How do I expose WooCommerce purchase data to GTM?
Use GTM4WP's ecommerce integration. Its purchase payload includes ecommerce.transaction_id, ecommerce.value, ecommerce.currency and purchased itemsraw.githubusercontent.com.
2. Enable ecommerce and connect Preview
- In GTM4WP settings, enter the staging container ID.
- Enable WooCommerce > General > Track e-commerce, following the plugin settings referencegtm4wp.com.
- Connect the store in GTM Previewsupport.google.com.
- Place a test order.
Done when a purchase event appears with the order's ID, value, currency and products.
GTM4WP offers purchase settings that exclude tax or shipping from revenuegtm4wp.com. Compare ecommerce.value with the configured amount definition, not automatically with the grand total. Test payment methods and failed orders before accepting the plugin's event as your intended sales signal.
03How do I configure the Google Ads purchase tag?
Use the purchase action's ID and label, then map the order fields.
3. Confirm the base Google tag
- Reuse the Google tag connected to the intended Ads account.
- If it is missing, create Google tag, following Google's setup instructionssupport.google.com.
- In the new tag, enter that account's Google tag ID.
- In the new tag, select Initialization - All Pages.
Google says a separate Conversion Linker is unnecessary when the container loads a Google tag on every pagesupport.google.com. If your installation still uses a Conversion Linker, check its landing-page coverage instead of adding another.
Done when its ID is correct and Preview shows it firing.
4. Select the purchase conversion action
Open the action that should receive this store's purchases.
- Use a dedicated website conversion action named for Purchase.
- In Goals > Conversions > Summary, open it.
- Open Tag setup > Use Google Tag Manager.
- Copy its Conversion ID and Conversion Label; Google documents the ID as account-specific and the label as action-specificsupport.google.com.
- Choose different values for each conversion if you want to send the order amount, as described in Google's transaction-value guidesupport.google.com.
Done when your notes contain this action's ID, label and chosen value setting.
5. Create order variables and the trigger
Use the order payload observed in Preview.
A Data Layer Variablesupport.google.com reads a named value from the data layer, the data your store exposes to GTM. A Custom Event trigger tells GTM when to run the tag.
- Create the variables below using Version 2 for nested paths.
- Create a Custom Event trigger with the event name
purchase. - Leave regular-expression matching off.
DLV - Value
- Data Layer Variable name
- ecommerce.value
DLV - Currency
- Data Layer Variable name
- ecommerce.currency
DLV - Transaction ID
- Data Layer Variable name
- ecommerce.transaction_id
Done when the saved paths and trigger name match this table and the event payload.
6. Configure the purchase conversion tag
Enter the purchase action's ID and label.
- Open Tags > New > Google Ads Conversion Tracking.
- Enter the fields below. Google supports value, currency and transaction ID in addition to the required ID and labelsupport.google.com.
- Save the tag.
Tag type
- Set it to
- Google Ads Conversion Tracking
Conversion ID
- Set it to
- The intended Google Ads account's ID
Conversion Label
- Set it to
- The label from this event's conversion action
Conversion Value
- Set it to
- {{DLV - Value}}
Currency Code
- Set it to
- {{DLV - Currency}}
Transaction ID
- Set it to
- {{DLV - Transaction ID}}
Trigger
- Set it to
- Custom Event: purchase
Done when reopening the tag shows the intended action, these mappings and the event-specific trigger.
An empty or undefined Conversion Value is sent as 0support.google.com. If the value variable is missing, fix the payload before proceeding. Google requires numeric conversion values and an ISO 4217 currency codesupport.google.com.
Google rejects a duplicate when the same conversion action receives the same transaction IDsupport.google.com. Keep the order ID stable on a revisit and different for a different order; do not replace it with a customer ID.
04Can I send the purchased products for remarketing?
Yes, as a separate optional tag with verified feed identifiers.
7. Add optional purchase remarketing
Keep the conversion tag independent of the item mapping.
Add dynamic remarketing only after confirming the product identifiers against the feed. Google's retail schema requires id to match a Merchant Center id, item_group_id or display_ads_idsupport.google.com. A GA4 item_id is not automatically that match.
- Create a Version 2 Data Layer Variable named DLV - Items for
ecommerce.items. - Only if each non-empty
item_idalready matches your feed, create a Custom JavaScript variable named JS - Ads items with this mapping. Otherwise stop here and have the feed owner supply the mapping; do not invent a prefix or substitute a product title.
function () { var items = {{DLV - Items}}; if (!Array.isArray(items)) return []; return items.filter(function (item) { return item && item.item_id != null && String(item.item_id).trim() !== "";
4 more lines of JavaScript
- Copy and download
- Emailed to you
Unlock this snippet
Two details, and the full code is yours
No account needed. Unlock once and every snippet on the blog opens.
- Create JS - Ads item count as the Custom JavaScript function below.
function () {
return {{JS - Ads items}}.length;
}
- Duplicate the event trigger for this remarketing tag.
- Choose Some Custom Events, with JS - Ads item count greater than 0.
- Keep the conversion tag on its original trigger so missing product IDs do not discard its value.
- Create the remarketing tag with the fields below.
Tag type
- Set it to
- Google Ads Remarketing
Conversion ID
- Set it to
- The account's remarketing Conversion ID
Conversion Label
- Set it to
- Leave empty unless the remarketing list itself supplies one
Send dynamic remarketing event data
- Set it to
- Checked
Event Name
- Set it to
- purchase
Event Value
- Set it to
- {{DLV - Value}}
Event Items
- Set it to
- {{JS - Ads items}}
Trigger
- Set it to
- purchase with JS - Ads item count greater than 0
Google documents Event Name, Event Value and Event Items for dynamic remarketingsupport.google.com. Do not paste a conversion-action label into a remarketing tag: Google warns that doing so inflates conversion countssupport.google.com.
Done when Preview shows the expected event name, feed-matched IDs and value; an item without an ID is absent, and an all-empty array prevents only the remarketing tag from firing.
05How do I check purchase value and duplicate orders?
Compare new orders and revisits in Preview before handing the draft to the release owner.
8. Test orders, revisits and consent
- Complete a fresh order.
- Reopen its confirmation page.
- Place a different order.
- Record whether a purchase event repeats and whether any repeated request keeps the original ID.
- Test each payment route.
- Test a failed order.
- Test both consent choices.
Done when the tag fields agree with each valid order, a second order has a different ID, and failed payment or consent cases match the documented plan.
06Which mistakes make WooCommerce purchase totals wrong?
Start with the value basis, ID and conversion action.
- A missing conversion value is sent as 0support.google.com. Fix the source variable instead of inserting a made-up amount.
- Reusing one transaction ID across orders can undercount conversionssupport.google.com. Map the store's real order identifier.
- Comparing a tax-excluded payload with a tax-inclusive total creates a false mismatch. Record the plugin's tax and shipping settings.
07Do I need to publish before testing the purchase tag?
No. GTM Preview tests the draft before publicationsupport.google.com. Keep the tested draft and evidence for the normal release process; do not publish the live container as a tutorial step. Preview verifies the local tag payload, while attribution and Ads reporting require their own account checks.
08What changed in this guide
- 25 October 2026: Added verified GTM4WP purchase mappings, stable transaction IDs and value-basis checks; separated optional remarketing and replaced live publishing with Preview tests.
Sources
13 sources
- 1Google uses matching transaction IDs to reject duplicate conversions for the same actionsupport.google.com↩
- 2Its purchase payload includes ecommerce.transaction_id, ecommerce.value, ecommerce.currency and purchased itemsraw.githubusercontent.com↩
- 3the plugin settings referencegtm4wp.com↩
- 4GTM Previewsupport.google.com↩
- 5GTM4WP emits checkout and purchase as separate eventsraw.githubusercontent.com↩
- 6Google's setup instructionssupport.google.com↩
- 7Google says a separate Conversion Linker is unnecessary when the container loads a Google tag on every pagesupport.google.com↩
- 8Google documents the ID as account-specific and the label as action-specificsupport.google.com↩
- 9Google's transaction-value guidesupport.google.com↩
- 10Data Layer Variablesupport.google.com↩
- 11Google's retail schema requires id to match a Merchant Center id, item_group_id or display_ads_idsupport.google.com↩
- 12Google documents Event Name, Event Value and Event Items for dynamic remarketingsupport.google.com↩
- 13Do not paste a conversion-action label into a remarketing tag: Google warns that doing so inflates conversion countssupport.google.com↩


