Guide 30 · Ecommerce · GA4 + Tag Manager
Send the add_to_cart event: the click, the items, and the value that makes the cart reports work
Add to cart is the event the purchase funnel and the Ecommerce purchases report both depend on: send it on the click, with the items just added and their value.
After step 4, DebugView shows an add_to_cart event with value 30.03 and the tee in the items array, fired once per click. After about 24 hours, the Ecommerce purchases report shows the item in Items added to cart, and the purchase journey shows the Add to cart step.
Download the reference: the add-to-cart-event reference (JSON) (1076 bytes, MD5 e83cd9b22a7f598cdbfc895387b39434). It holds the event parameters, the worked example, and the recomputed figures.
What you need
- The Google tag on the site. The event is sent through the Google tag; the install guide covers it.
- Access to the website source code, or a Tag Manager container. The event fires from the add-to-cart click, so it needs the click handler or a data layer push at that point.
- The product details for the item being added. The worked item is Google's own: Stan and Friends Tee, SKU_12345, 10.01 each, quantity 3, discount 2.22 per unit.
The trace
- Fire the event on the click, not on the page load. The add_to_cart event measures the action of adding, so it belongs in the click handler for the add-to-cart button, or in the data layer push that handler makes. Send
gtag("event", "add_to_cart", { currency: "USD", value: 30.03, items: [{ item_id: "SKU_12345", item_name: "Stan and Friends Tee", price: 10.01, quantity: 3 }] }). The value is the added items only: 10.01 × 3 = 30.03. - Send the items that were just added, not the whole cart. The items array holds what this click added. If the visitor adds three tees, the array holds the tee with quantity 3. The cart total is a different number and belongs to view_cart, not to add_to_cart.
- Send quantity, or Analytics assumes 1. Quantity defaults to 1 when it is not set. Three tees sent without a quantity are counted as one tee, so the value 30.03 would disagree with a quantity of 1 at 10.01. Always send the quantity the visitor chose.
- Check it in DebugView. Turn on debug mode, click add to cart, and open DebugView (Admin, then Data display, then DebugView). Select the add_to_cart event and check the value reads 30.03 and the items array holds the tee with price 10.01 and quantity 3. One click must produce one event.
- Confirm the reports after about 24 hours. The Ecommerce purchases report counts items added to cart from this event, and the purchase journey funnel uses it as the Add to cart step. If the report shows views but no add to carts, the event is not firing where the button is.
Dead ends
DEAD END — ADD_TO_CART ON PAGE LOAD. An add_to_cart that fires when the product page loads counts every viewer as a buyer. The add-to-cart rate in the Ecommerce purchases report then reads near 100 percent while real carts stay empty. The event belongs on the click.
DEAD END — THE MISSING QUANTITY. Quantity defaults to 1. A visitor who adds three tees, sent without a quantity, is recorded as adding one. The revenue math then breaks: value 30.03 against one item at 10.01. Send the quantity every time.
DEAD END — VALUE WITHOUT CURRENCY. Google's rule is that currency is required whenever value is set. An add_to_cart with a value and no currency leaves Analytics unable to compute the revenue, so the event arrives but the money does not.
End state
Every add-to-cart click sends one add_to_cart event with the items just added, their quantities, a numeric value equal to price times quantity (10.01 × 3 = 30.03), and currency USD. The item discount is recorded separately: 2.22 per unit, 6.66 for the three tees. DebugView shows the event the same minute, and after about 24 hours the Ecommerce purchases report and the purchase journey both count it.
Sources
- Google Analytics developer docs — Measure ecommerce — the add_to_cart event, its items array, and the currency rule for value
- Google Analytics developer docs — Recommended events — the add_to_cart parameters, the value rule, and quantity defaulting to 1
Checked 11 November 2026. The event definition above is the one in Google's ecommerce developer guide and the recommended events reference, both opened 11 November 2026. No step was run inside a live Analytics property, because that needs a Google sign-in and this site does not sign in as anyone. The figures were recomputed in Python: 10.01 × 3 = 30.03, and the item discount 2.22 × 3 = 6.66. The reference file was checked the same way: its value equals the sum of price times quantity for its items.