WooCommerce Google Ads view_cart tracking with GTM
Track WooCommerce cart views in Google Ads with GTM4WP, correct GTM triggers, feed-matched remarketing items and Preview checks.
Shahzada Ali Hassan, founder of Crisperchecked against 14 sources
The short answer
Track WooCommerce cart views in Google Ads by using GTM4WP's view_cart data-layer event to trigger the right tag. Google warns against conversion-action labels on remarketing tagssupport.google.com. This guide is for store owners and implementers who need to check event data before choosing remarketing or separate conversion reporting.
- If GTM4WP already provides the event, reuse it rather than adding a second data-layer script.
- Use
view_cartas the exact GTM Custom Event name. - Keep the remarketing label separate from a conversion-action label.
- 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 cart views in Google Ads?
Inspect a nonempty full cart first, then change its quantities and reopen the cart to compare the next view_cart payload. Check the items, quantities, value and currency together. A label such as View Cart in the interface is not a substitute for the actual data-layer event name.
The video shows the older plugin and tag setup; use the current written steps below for event names, data fields and tag settings.
02What access do I need for this setup?
You or whoever manages the store needs access to WordPress plugin settings, the intended GTM workspace and the Google Ads tag details.
1. Identify the test store and existing senders
- Use a staging store and test GTM container for these changes.
- Record any plugin or tag that already sends the same action.
Done when you can open the plugin settings and GTM workspace and identify the destination Ads account.
03How do I connect WooCommerce to GTM4WP?
Use GTM4WP by Thomas Geigerwordpress.org to load the web container and expose WooCommerce events.
2. Configure the plugin
- Install and activate GTM4WP on the staging store if it is not already installed.
- In its settings, enter the test container ID.
- Enable container output.
- In the WooCommerce section, turn on Track e-commerce, as described in GTM4WP's setup guidegtm4wp.com.
- Save the settings.
Done when the saved settings contain the intended container ID and ecommerce tracking is enabled.
04How do I check that GTM is connected?
Connect the staging URL through GTM Previewsupport.google.com. Preview runs the draft workspace without publishing it.
3. Connect a Preview session
- Open Preview.
- Enter the staging-store URL and connect.
- Exercise the consent banner using the store's existing consent implementation.
Done when Tag Assistant shows the intended container and the consent state matches your choice.
05Where does GTM4WP put view_cart data?
Inspect the event's ecommerce object in Preview. GTM4WP's page-data coderaw.githubusercontent.com pushes view_cart with ecommerce.items, ecommerce.value and ecommerce.currency.
4. Inspect the actual event payload
- Put products in the cart.
- Visit the full cart page.
- Inspect
view_cart; the plugin skips this event when the cart has no productsraw.githubusercontent.com.
Done when the event name and products match your action, with no stale items from the previous page.
Check id and google_business_vertical on each product. GTM4WP's product builderraw.githubusercontent.com includes a separate remarketing identifier based on its settings. Do not replace it blindly with item_id, a SKU or a parent ID; compare the actual output with the Merchant Center feed.
view_cart is the plugin event and the custom Ads name used here. It is not listed in Google's recommended dynamic-remarketing eventssupport.google.com; keep it distinct from add_to_cart, which describes adding a product.
06Should I count cart views as conversions?
Only create a conversion action if you deliberately want this action in conversion reporting. The remarketing path does not require one.
A remarketing tag sends audience datasupport.google.com; a conversion tag records a separately configured conversion actionsupport.google.com. Google makes the remarketing label optionalsupport.google.com and warns that a conversion-action label in that field inflates conversion counts.
5. Decide whether to add a conversion action
- For optional conversion reporting, create a manual Website conversion action in Google Ads.
- Obtain its Conversion ID and Label from Use Google Tag Manager, following Google's conversion setupsupport.google.com.
- For an observation-only setup, select Secondary.
- Keep the action out of custom goals: Google says custom goals use even secondary actions for biddingsupport.google.com.
Done when the action's name, ID, label and optimization setting match your intended use.
07How do I configure the view_cart tags in GTM?
Create the data variables first, then keep the remarketing and optional conversion tags separate.
- Use the intended account's Conversion ID from its Google Ads tag setupsupport.google.com.
- Add or reuse the associated Google tag: select Tags > New > Google tag.
- Enter its Tag ID.
- Choose Initialization - All Pages, following Google's setup instructionssupport.google.com.
Google says a separate Conversion Linker is unnecessarysupport.google.com when that destination's Google tag loads on every page.
Done when the saved Google tag has the intended Tag ID and trigger, with your consent defaults and updates configured.
Create the variables and item filter
A Data Layer Variable reads a named value from the data layer, the event data your site gives GTM.
- Create each variable below in Variables > New, following Google's variable referencesupport.google.com.
- Select Data Layer Variable as the type.
- Select Version 2 for nested paths.
DLV - Value
- Data layer variable name
- ecommerce.value
- Use
- Remarketing Event Value
DLV - Items
- Data layer variable name
- ecommerce.items
- Use
- Source items for the filter below
DLV - Currency
- Data layer variable name
- ecommerce.currency
- Use
- Compare with the displayed amount
- Create a Custom JavaScript variable named
CJS - Remarketing itemswith this function.
function() { var items = {{DLV - Items}}; if (!Array.isArray(items)) return []; return items.filter(function(item) { return item && item.id != null && String(item.id).trim() !== "" && item.google_business_vertical === "retail";
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.
It keeps existing retail IDs and drops blank ones; it does not guess a feed ID.
- Create another Custom JavaScript variable named
CJS - Has remarketing itemswith the function below.
function() {
return {{CJS - Remarketing items}}.length > 0;
}
Done when the saved paths match the table, the saved CJS - Remarketing items code references DLV - Items, and CJS - Has remarketing items returns false for an empty item list and true for a list with a valid retail ID.
Save the trigger and remarketing tag
A trigger tells GTM when to run a tag.
- Create a Custom Event trigger named for
view_cart. - Enter
view_cartas its event name. - Leave regular-expression matching off.
- Select Some Custom Events.
- Require
CJS - Has remarketing itemsequalstrue. - Create a Google Ads Remarketing tag.
- Enter the intended Conversion ID.
- Leave Conversion Label blank.
- Enable Send dynamic remarketing event data.
- Set Event Name to
view_cart. - Set Event Items to
CJS - Remarketing items. - Set Event Value to
DLV - Value. - Attach the trigger above.
- Save the tag.
These are the fields in Google's GTM configuration examplesupport.google.com.
Done when the saved trigger has both the exact event name and item condition, and reopening the tag shows these settings.
Keep ecommerce.currency available for the amount check. Google's dynamic-tag examplesupport.google.com maps Event Name, Event Value and Event Items; it does not map currency. The separate conversion tag has a Currency Code fieldsupport.google.com. Do not assume that a currency stored in the data layer was sent by a tag.
Add the optional conversion tag
Google's conversion tagsupport.google.com accepts Conversion Value and Currency Code.
- If you created the conversion action, add a Google Ads Conversion Tracking tag.
- Enter that action's ID and Label.
- Map Conversion Value to
DLV - Value. - Map Currency Code to
DLV - Currency. - Create a separate Custom Event trigger for
view_cartwithout the remarketing item condition. - Apply the store's existing consent implementation to these tags using Google's consent-mode guidancedevelopers.google.com.
Treat this as the viewed cart value, not a completed order. Do not invent a transaction ID for a view event.
Done when the conversion tag has the action's label, the remarketing tag remains label-free, and the documented consent defaults and updates match the choices you test.
08How do I test WooCommerce cart views?
Use GTM Previewsupport.google.com to inspect the event and tags on the staging store before any release.
6. Compare the event with the outgoing requests
- Open a nonempty cart.
- Change its quantities.
- Return to the cart.
- Check that
view_cartshows the current items, amount and currency; an empty cart sends no product-bearing event. - Select
view_cartin Tag Assistant. - Check that the remarketing tag appears under Tags Fired only with a nonempty filtered item list, and the optional conversion tag fires only if you configured it.
- Inspect each tag's resolved variables and outgoing Google Ads request.
- Compare the account ID, event or conversion label, and available amount and currency with the test data.
- Check that the remarketing request contains feed-matched items.
- Repeat with the consent choices your store offers.
Tag firing in Preview is not proof of an attributed Ads conversion or audience eligibility.
Done when every check above matches, and your notes record the observed behavior for both consent choices and explain any missing request.
09Do I need to publish GTM to test these tags?
No. Google's Preview modesupport.google.com tests a workspace before it is published. Save the checks and take the tested setup through your normal release process; these instructions do not call for publishing a live-store container.
10Why are my WooCommerce cart-view tags wrong?
Check the source event before changing the tag. This guide is the wrong fix if the event never appears; repair the plugin integration first.
- Using a display name instead of
view_cartprevents the Custom Event trigger from matching. Copy the event name from Preview. - Guessing the Merchant Center ID can make the tag send an unmatched product. Compare a real feed entry and correct the plugin mapping before using dynamic remarketing.
- An amount paired with the wrong currency misstates the viewed value. Check both variables on the same event instead of using a fixed store currency.
11What should I check after these tags?
If the container still does not connect, use the WooCommerce GTM setup guide. For completed orders, follow the purchase data checks instead of treating a view as a sale.
12What changed in this guide
- 25 October 2026: Corrected the
view_carttrigger and GTM4WP field mappings, separated remarketing labels from conversion labels, added filtered retail items and Preview checks, and removed live-container publishing. Added event-specific amount and currency checks. Replaced the repeated opening with a full-cart check before and after quantity changes.
Sources
14 sources
- 1Google warns against conversion-action labels on remarketing tagssupport.google.com↩
- 2GTM4WP by Thomas Geigerwordpress.org↩
- 3GTM4WP's setup guidegtm4wp.com↩
- 4GTM Previewsupport.google.com↩
- 5GTM4WP's page-data coderaw.githubusercontent.com↩
- 6Google requires each retail id to match the Merchant Center feedsupport.google.com↩
- 7GTM4WP's product builderraw.githubusercontent.com↩
- 8conversion tag records a separately configured conversion actionsupport.google.com↩
- 9Google says custom goals use even secondary actions for biddingsupport.google.com↩
- 10Google's setup instructionssupport.google.com↩
- 11Google says a separate Conversion Linker is unnecessarysupport.google.com↩
- 12Google's variable referencesupport.google.com↩
- 13Google's GTM configuration examplesupport.google.com↩
- 14Google's consent-mode guidancedevelopers.google.com↩


