Skip to content

remove_from_cart

The remove_from_cart event tracks when a user removes a product from their cart or reduces its quantity. This is your cart abandonment signal at the item level — before the session even ends.

Remove-from-cart data lets you identify which products get added and then second-guessed, what price points cause hesitation, and which products have high add-to-cart rates but low purchase conversion. That’s actionable product and pricing intelligence.

Fire remove_from_cart when:

  • A user clicks a “Remove” button in the cart
  • A user reduces quantity in the cart (fire for the delta removed)
  • A user clears the entire cart (fire for all items removed, or one event with all removed items)

As with add_to_cart, fire after confirmation — after the cart API call succeeds, not on the button click.

// User removes one item from cart
dataLayer.push({ ecommerce: null });
dataLayer.push({
event: 'remove_from_cart',
ecommerce: {
currency: 'USD',
value: 89.99, // value of what's being removed
items: [
{
item_id: 'SKU-001-BLK-L',
item_name: 'Classic Leather Jacket',
item_brand: 'Heritage Co.',
item_category: 'Apparel',
item_category2: 'Outerwear',
item_category3: 'Jackets',
item_variant: 'Black / Large',
price: 89.99,
quantity: 1, // quantity being removed
affiliation: 'Online Store'
}
]
}
});
Event Schema remove_from_cart
Parameter Type Required Description
event string Required Must be "remove_from_cart"
ecommerce.currency string Required ISO 4217 currency code.
ecommerce.value number Required Total value being removed — price × quantity of each item removed.
ecommerce.items[] Array<Item> Required Array of items being removed.
items[].item_id string Required SKU or variant-level product identifier.
items[].item_name string Required Product name.
items[].item_brand string Optional Brand or manufacturer.
items[].item_category string Optional Primary product category.
items[].item_variant string Optional Variant being removed.
items[].price number Optional Unit price at time of removal.
items[].quantity number Optional Number of units being removed — the delta, not the remaining cart quantity.

When a user reduces quantity from 3 to 1, they’re removing 2 units. Fire remove_from_cart with quantity: 2 and value: price × 2.

// User reduces from 3 to 1 — removing 2 units
const unitPrice = 24.99;
const quantityRemoved = 2;
dataLayer.push({ ecommerce: null });
dataLayer.push({
event: 'remove_from_cart',
ecommerce: {
currency: 'USD',
value: unitPrice * quantityRemoved, // 49.98
items: [{
item_id: 'SKU-047-WHT-M',
item_name: 'Cotton Crew T-Shirt',
item_brand: 'Heritage Co.',
item_category: 'Apparel',
item_variant: 'White / Medium',
price: unitPrice,
quantity: quantityRemoved // 2 — not the new total of 1
}]
}
});

If a user clears their entire cart or removes multiple items in one action, include all removed items in a single event.

// User clears entire cart with 3 items
const removedItems = [
{ item_id: 'SKU-001-BLK', item_name: 'Classic Leather Jacket', price: 89.99, quantity: 1 },
{ item_id: 'SKU-047-WHT', item_name: 'Cotton Crew T-Shirt', price: 24.99, quantity: 2 },
{ item_id: 'SKU-112-TAN', item_name: 'Woven Leather Belt', price: 34.50, quantity: 1 }
];
const totalValue = removedItems.reduce((sum, item) => sum + (item.price * item.quantity), 0);
dataLayer.push({ ecommerce: null });
dataLayer.push({
event: 'remove_from_cart',
ecommerce: {
currency: 'USD',
value: parseFloat(totalValue.toFixed(2)),
items: removedItems
}
});
  1. Create a Custom Event trigger. Event name: remove_from_cart. Name it CE - remove_from_cart.

  2. Create Data Layer Variables for ecommerce.currency, ecommerce.value, and ecommerce.items.

  3. Create the GA4 Event tag. Event name: remove_from_cart. Enable Send Ecommerce data. Add currency and value as explicit event parameters.

  4. Test in Preview mode. Add items to cart, then remove one. Check that quantity is the removed amount, not the total cart quantity.

Reporting the remaining cart quantity instead of the removed quantity. After removing 2 of 3 units, the cart has 1 unit remaining. The event should have quantity: 2 (what was removed) — not quantity: 1 (what remains).

Not firing when quantity is reduced to zero. Reducing quantity to 0 is functionally the same as clicking Remove. Make sure both paths trigger the event.

Using a stale price. Capture the price at the time of removal, not at the time the item was originally added. Prices can change while items sit in a cart.