WooCommerce7 min read12 views

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.

Watch on YouTube

Jump to the code

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 purchase with 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.

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 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

  1. Select a test payment route.
  2. Record the order amount definition you want to send.

Done when your notes name the container, Ads purchase action, existing sender and test gateway.

How 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

  1. In GTM4WP settings, enter the staging container ID.
  2. Enable WooCommerce > General > Track e-commerce, following the plugin settings referencegtm4wp.com.
  3. Connect the store in GTM Previewsupport.google.com.
  4. 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.

How 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

  1. Reuse the Google tag connected to the intended Ads account.
  2. If it is missing, create Google tag, following Google's setup instructionssupport.google.com.
  3. In the new tag, enter that account's Google tag ID.
  4. 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.

  1. Use a dedicated website conversion action named for Purchase.
  2. In Goals > Conversions > Summary, open it.
  3. Open Tag setup > Use Google Tag Manager.
  4. Copy its Conversion ID and Conversion Label; Google documents the ID as account-specific and the label as action-specificsupport.google.com.
  5. 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.

  1. Create the variables below using Version 2 for nested paths.
  2. Create a Custom Event trigger with the event name purchase.
  3. 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
Variable names are local names you create; the right column must match the payload.

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.

  1. Open Tags > New > Google Ads Conversion Tracking.
  2. Enter the fields below. Google supports value, currency and transaction ID in addition to the required ID and labelsupport.google.com.
  3. 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
The conversion action is selected by its label, not by the GTM trigger name.

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.

Can 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.

  1. Create a Version 2 Data Layer Variable named DLV - Items for ecommerce.items.
  2. Only if each non-empty item_id already 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.
javascript10 lines
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.

We email you a copy.

  1. Create JS - Ads item count as the Custom JavaScript function below.
javascript
function () {
  return {{JS - Ads items}}.length;
}
  1. Duplicate the event trigger for this remarketing tag.
  2. Choose Some Custom Events, with JS - Ads item count greater than 0.
  3. Keep the conversion tag on its original trigger so missing product IDs do not discard its value.
  4. 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
The items field receives an array, not JSON text.

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.

How 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

  1. Complete a fresh order.
  2. Reopen its confirmation page.
  3. Place a different order.
  4. Record whether a purchase event repeats and whether any repeated request keeps the original ID.
  5. Test each payment route.
  6. Test a failed order.
  7. 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.

Which mistakes make WooCommerce purchase totals wrong?

Start with the value basis, ID and conversion action.

Do 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.

What 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
  1. 1Google uses matching transaction IDs to reject duplicate conversions for the same action↩
  2. 2Its purchase payload includes ecommerce.transaction_id, ecommerce.value, ecommerce.currency and purchased items↩
  3. 3the plugin settings reference↩
  4. 4GTM Preview↩
  5. 5GTM4WP emits checkout and purchase as separate events↩
  6. 6Google's setup instructions↩
  7. 7Google says a separate Conversion Linker is unnecessary when the container loads a Google tag on every page↩
  8. 8Google documents the ID as account-specific and the label as action-specific↩
  9. 9Google's transaction-value guide↩
  10. 10Data Layer Variable↩
  11. 11Google's retail schema requires id to match a Merchant Center id, item_group_id or display_ads_id↩
  12. 12Google documents Event Name, Event Value and Event Items for dynamic remarketing↩
  13. 13Do not paste a conversion-action label into a remarketing tag: Google warns that doing so inflates conversion counts↩