WooCommerce Google Ads add-to-cart tracking with GTM
Track WooCommerce add-to-cart events in Google Ads with GTM4WP, exact trigger names, value mappings and optional feed-matched remarketing.
Shahzada Ali Hassan, founder of Crisperchecked against 14 sources
The short answer
Track WooCommerce cart additions with a Google Ads conversion tag triggered by GTM4WP's add_to_cart event. Google requires a conversion ID and an action-specific labelsupport.google.com. This guide is for store owners and implementers who want to observe cart activity and test optional product remarketing without treating it as a sale.
- If you only want to observe cart additions, review Secondary and custom-goal settings.
- Use
add_to_cart, with underscores, as the GTM trigger. - Keep conversion labels out of ordinary remarketing tags.
- 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
01How do I track WooCommerce add to cart in Google Ads?
Send the cart event to its own conversion action, then test the values on the same event. If GTM is missing, start with the WooCommerce Google Ads page-view setup. The video shows the older configuration; the written steps below correct the trigger, tag fields and testing method.
02What access do I need before setting up cart tracking?
Use a staging store, its GTM web container and the intended Ads account. Record existing plugins or tags that already send cart conversions; this guide is the wrong fix for an event that is already sent correctly.
1. Record the test setup
- Open WordPress plugin settings.
- Open the GTM workspace.
- Open the Ads conversion action you intend to use.
- Record the staging URL, container ID, account and existing sender.
Keep your consent configuration in place.
Done when the staging URL, container ID, account and existing sender are recorded.
03Which WordPress plugin supplies the data layer?
GTM4WP by Thomas Geiger installs GTM container code and exposes a data layerwordpress.org. Use that plugin for this guide; another plugin may have a different payload.
2. Connect GTM4WP to the staging container
- Install or open GTM4WP.
- Enter the staging container ID in its settings.
- Save the settings.
Avoid a second installation of the same container in the theme.
Done when the saved ID matches the container you will preview.
04How do I check that GTM loads on WooCommerce?
GTM Preview tests an unpublished workspace on a normal web pagesupport.google.com.
3. Connect Preview
- Select Preview.
- Enter the staging store URL.
- Choose Connect.
Done when Tag Assistant shows the intended container connected on the product page.
05Should add to cart be a primary conversion?
Use Secondary for this observation exercise; choose bidding goals separately with the account owner.
4. Select the cart conversion action
Choose the action for cart additions, not the purchase action.
- Use a dedicated website conversion action named for Add to cart.
- 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.
- For observation, choose Secondary.
- Keep it out of custom bidding goals: secondary actions are still used for bidding when included in a custom goalsupport.google.com.
- Choose different values for each conversion for this event-value example, following Google's value settingssupport.google.com.
Done when your notes contain this action's ID, label and chosen value setting.
06How do I enable WooCommerce cart data in GTM4WP?
The Track e-commerce setting enables GTM4WP's WooCommerce data layergtm4wp.com.
5. Enable ecommerce data
- Open GTM4WP settings > WooCommerce > General. In older 1.x versions it is under Integration > WooCommercegtm4wp.com.
- Enable Track e-commerce.
- Save the settings.
- Refresh the staging store.
Done when an add-to-cart test creates add_to_cart with an ecommerce object in Preview.
07Which cart value should I send to Google Ads?
Use the value attached to this cart event. GTM4WP's cart handlers calculate value from the affected products and quantitiesraw.githubusercontent.com.
6. Inspect the added product
- Add a chosen variant and quantity.
- At
add_to_cart, inspectecommerce.value,ecommerce.currencyandecommerce.items. - Compare the amount and quantity with what was actually added, including a cart drawer or quick-add route if the store has one.
Done when those values match the tested cart change.
08Do I need a Conversion Linker as well as the Google tag?
Check the existing Google tag before adding a linker.
7. Confirm the base tag
- Open the container's current Google tag configuration.
- Reuse the Google tag connected to the intended Ads account.
- If it is missing, create Google tag, following Google's setup instructionssupport.google.com.
- For a new tag, enter that account's Google tag ID.
- For a new tag, select Initialization - All Pages.
- If your installation still uses a Conversion Linker, check its landing-page coverage instead of adding another.
Google says a separate Conversion Linker is unnecessary when the container loads a Google tag on every pagesupport.google.com.
Done when Preview shows the intended Google tag firing on the staging page.
09What trigger and variables should I use for add to cart?
Use the exact data-layer event name add_to_cart.
8. Create the cart variables and trigger
Use the payload inspected in step 6.
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 in the table below using Version 2 for nested paths.
- Create a Custom Event trigger that uses
add_to_cart. - Leave regular-expression matching off.
DLV - Value
- Data Layer Variable name
- ecommerce.value
DLV - Currency
- Data Layer Variable name
- ecommerce.currency
Done when the saved paths and trigger name match this table and the event payload.
10How do I configure the add-to-cart conversion tag?
Use the cart action's label and map its value and currency.
9. Save the conversion tag
Google supports value, currency and transaction ID in addition to the required ID and labelsupport.google.com.
- In Tags > New > Google Ads Conversion Tracking, create a separate tag for this conversion action.
- Enter the fields in the table below.
- 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
- Leave empty; this event is not an order
Trigger
- Set it to
- Custom Event: add_to_cart
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.
Done when reopening the tag shows the intended action, these mappings and the event-specific trigger.
11How do I send cart products for dynamic remarketing?
Use a separate remarketing tag with feed-matched product IDs.
10. Add optional product remarketing
Skip this step if you do not have a verified Merchant Center feed 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 the mapping below.
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 Google Ads Remarketing tag with the fields in the table 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
- add_to_cart
Event Value
- Set it to
- {{DLV - Value}}
Event Items
- Set it to
- {{JS - Ads items}}
Trigger
- Set it to
- add_to_cart 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.
12How do I test the cart conversion before release?
Repeat cart actions in Preview and compare the fired tags with the cart.
11. Test success, failure and consent
- Refresh Preview.
- Add a simple product.
- Add a variant.
- Try an unsuccessful cart action.
- Inspect the conversion label, value and currency on each fired tag.
- Exercise both consent choices using the store's existing consent setup.
Done when successful additions match the cart, failed additions produce no successful-cart conversion, and consent behavior matches your plan.
13Do I need to publish GTM to test this setup?
No. Preview runs the draft for your test browser before publicationsupport.google.com. Keep these changes as a reviewed draft and move the tested setup through your normal release process.
14What should I fix if cart conversions look wrong?
Check the event name, the sender and the remarketing label first.
- A trigger named "Add to Cart" misses a payload named
add_to_cart. Match the exact name shown in Preview. - A second cart sender makes it harder to attribute each request. Identify the owner of each tag before keeping both.
- A conversion-action label in remarketing can inflate conversion countssupport.google.com. Leave that label empty unless a tag-based list supplies it.
15What changed in this guide
- 25 October 2026: Corrected GTM4WP event and field mappings, conversion versus remarketing labels, feed IDs, goal settings and Preview-only testing.
Sources
14 sources
- 1Google requires a conversion ID and an action-specific labelsupport.google.com↩
- 2GTM4WP by Thomas Geiger installs GTM container code and exposes a data layerwordpress.org↩
- 3GTM Preview tests an unpublished workspace on a normal web pagesupport.google.com↩
- 4secondary actions are still used for bidding when included in a custom goalsupport.google.com↩
- 5Google's value settingssupport.google.com↩
- 6The Track e-commerce setting enables GTM4WP's WooCommerce data layergtm4wp.com↩
- 7GTM4WP's cart handlers calculate value from the affected products and quantitiesraw.githubusercontent.com↩
- 8GTM4WP exposes checkout data separatelyraw.githubusercontent.com↩
- 9Google's setup instructionssupport.google.com↩
- 10Google says a separate Conversion Linker is unnecessary when the container loads a Google tag on every pagesupport.google.com↩
- 11Data Layer Variablesupport.google.com↩
- 12Google's retail schema requires id to match a Merchant Center id, item_group_id or display_ads_idsupport.google.com↩
- 13Google documents Event Name, Event Value and Event Items for dynamic remarketingsupport.google.com↩
- 14Do not paste a conversion-action label into a remarketing tag: Google warns that doing so inflates conversion countssupport.google.com↩


