WooCommerce GA4 add_to_cart tracking with GTM
Set up WooCommerce add_to_cart in GTM with product data, exact GA4 event names and checks in Preview and DebugView.
Shahzada Ali Hassan, founder of Crisperchecked against 7 sources
The short answer
Send add_to_cart when shoppers add a product to the cart, using the product data supplied by WooCommerce. Google's ecommerce guidedevelopers.google.com uses an items array to describe the products involved in each action. This guide is for store owners and implementers who have GTM installed and need to map a WooCommerce data-layer event into GA4.
- If a plugin already sends this event to GA4, inspect it before adding a second tag.
- Send
add_to_cartas the GA4 event name. - Google requires currency when value is sentdevelopers.google.com.
- 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
01When should GA4 record add_to_cart?
Check the item and quantity added in one action before mapping the tag. Google's ecommerce exampledevelopers.google.com sends the added items in add_to_cart; compare that payload with the addition you made.
The data layerdevelopers.google.com is a JavaScript object that passes event names and values from the store to GTM.
02What do I need before adding the event tag?
You need the intended GA4 web stream, a working Google tag and ecommerce data from the store. If those are missing, start with the WooCommerce GTM and data-layer setup.
This is the wrong fix when a plugin already sends the correct event to the same stream. Inspect that sender first. For GTM4WP, the plugin's own instructionsgtm4wp.com require Track e-commerce to be enabled; a Google tag alone does not create product data.
03How do I set up add_to_cart in GTM?
Use the observed store event to trigger a GA4 Event tag, then map its ecommerce fields.
1. Inspect the store action
- Open GTM Preview on a staging store.
- Add a product to the cart.
- Select the data-layer event carrying that action's products.
- Record the exact event name.
Done when its items match the product and quantity you used, and you have recorded the exact event name.
2. Confirm the destination
Google's setup guidesupport.google.com documents the Google Analytics destination and the alternate Google tag method.
- Reuse the store's Google tag and GA4 web stream.
- For Google's alternate methodsupport.google.com, enter the stream's Measurement ID as Tag ID.
- For that method, use an Initialization trigger.
Done when the saved ID matches the intended stream.
3. Map the fields
Data Layer Variablessupport.google.com read named values from the data layer.
- Create a Data Layer Variable for each row in the table below.
- Choose Version 2 for nested fieldssupport.google.com.
- Enter the path from the table and save.
items
- Data Layer Variable path
- ecommerce.items
- Check
- The products involved in this action
currency
- Data Layer Variable path
- ecommerce.currency
- Check
- Currency matching the item prices
value
- Data Layer Variable path
- ecommerce.value
- Check
- Item value for this action, when provided
Google's ecommerce guidedevelopers.google.com requires currency when sending value and requires item_id or item_name for each item. Keep items as an array of product objects.
Done when each saved variable has the correct path and Preview resolves the variables to the current action, rather than an earlier cart.
4. Create the trigger and tag
A trigger is the condition that runs a tag.
- Save a Custom Event trigger whose event name exactly matches the data-layer event inspected in step 1. For example, use
add_to_cartonly if that is what the integration pushes. - Create a Google Analytics: GA4 Eventsupport.google.com tag.
- Enter the intended Measurement ID.
- Set Event Name to
add_to_cart. - Map each table row in Event Parameters.
- Attach the Custom Event trigger you saved in this step.
- Save the tag.
Done when the saved event name matches Preview, and reopening the tag shows that event name, stream, parameters and trigger.
04How do I test add_to_cart in GA4?
Compare the event sent by GTM with the event received by GA4.
5. Follow one action through both tools
- Repeat the action in Preview.
- Check that the GA4 tag fires on the observed add-to-cart data-layer event with the correct parameters.
- Enable debug modesupport.google.com for the test session.
- Open GA4 Admin > Data display > DebugView.
- Select
add_to_cartand compare its parameters and items with your test action. - Repeat with a different product and quantity.
- Test the store's consent choices.
- Record the cases you checked.
Keep debug_mode out of the final non-test configuration. A successful test covers the cases you recorded; it is not a count of every shopper's actions.
Done when the GA4 tag fires on the observed add-to-cart data-layer event with the correct parameters, and the event name, products, currency and amounts in DebugView agree with your test action.
05Why is my add_to_cart data missing or wrong?
Check the event name, item payload and existing senders before changing the reporting configuration.
- A trigger name that differs from the actual event leaves the tag without a match. Copy the name from Preview, including its case.
- Missing items leave no product details to inspect. Fix the data-layer integration before changing the GA4 tag.
- Two senders make repeated events hard to diagnose. Identify which plugin or GTM tag owns each request.
06What should I check next?
Continue with WooCommerce checkout tracking or compare the final order with the GA4 purchase mapping. Keep the same item identifiers across the funnel.
07What changed in this guide
- 25 October 2026: Added explicit add_to_cart parameter mappings, current Google tag setup, event-specific checks and duplicate-sender guidance; removed live-container publishing instructions. Replaced the repeated introduction with the next event-specific inspection step.

