remove_from_cart Event
The remove_from_cart
event is used to track when a user removes a product from their shopping cart. Capturing this behavior helps you identify friction points, product disengagement, and inform remarketing strategies.
The remove_from_cart model
The event model defines all properties needed to describe a user action of removing a product from the cart. It includes user and session identifiers, product metadata, and optional hashed user data for privacy-safe matching.
Properties
- Name
event
- Type
- string
- Description
Must be set to
remove_from_cart
.
- Name
user_id
- Type
- string
- Description
Unique identifier for the user performing the action.
- Name
session_id
- Type
- string
- Description
Unique identifier for the user's current session.
- Name
ecommerce.currency
- Type
- string
- Description
Currency code (ISO 4217), e.g.,
USD
.
- Name
ecommerce.value
- Type
- float
- Description
Value of the items being removed (after discount).
- Name
ecommerce.tax
- Type
- float
- Description
Tax associated with the removed items.
- Name
ecommerce.items
- Type
- array
- Description
Array of item objects that were removed from the cart.
- Name
ecommerce.items[].item_id
- Type
- string
- Description
SKU or product ID.
- Name
ecommerce.items[].item_name
- Type
- string
- Description
Product name.
- Name
ecommerce.items[].item_brand
- Type
- string
- Description
Brand or manufacturer name.
- Name
ecommerce.items[].item_category
- Type
- string
- Description
Main category the product belongs to.
- Name
ecommerce.items[].item_variant
- Type
- string
- Description
Specific variant info such as color, size, or edition.
- Name
ecommerce.items[].price
- Type
- float
- Description
Original item price.
- Name
ecommerce.items[].discount
- Type
- float
- Description
Discount applied to the item.
- Name
ecommerce.items[].tax
- Type
- float
- Description
Tax on this specific item.
- Name
ecommerce.items[].quantity
- Type
- int
- Description
Number of units removed.
- Name
user_data.external_id
- Type
- string
- Description
Optional external user identifier for cross-system mapping.
- Name
user_data.email_hash
- Type
- string
- Description
Hashed email (SHA-256, lowercase, trimmed).
- Name
user_data.phone_hash
- Type
- string
- Description
Hashed phone (SHA-256, lowercase, trimmed).
Push event to the dataLayer
Here is an example of how to structure and push the remove_from_cart
event to the dataLayer:
dataLayer.push example
dataLayer.push({
event: 'remove_from_cart',
user_id: '12345678-abcd-1234-efgh-1234567890ab',
session_id: 'abcd1234-efgh-5678-ijkl-0987654321zx',
ecommerce: {
currency: 'USD',
value: 49.99,
tax: 4.00,
items: [
{
item_id: 'SKU-00123',
item_name: 'GlowMaster Smart Lamp',
item_brand: 'LumaTech',
item_category: 'Home & Living',
item_variant: 'Matte Black',
price: 59.99,
discount: 10.00,
tax: 4.00,
quantity: 1
}
]
},
user_data: {
external_id: '12345678-abcd-1234-efgh-1234567890ab',
email_hash: 'abc123examplehashedemail0987',
phone_hash: 'def456examplehashedphone6543'
}
});
Best Practices
- Fire this event immediately when the user removes the item.
- Keep event structure consistent with your
add_to_cart
event for compatibility. - Include
currency
,value
, and hashed identifiers for audience targeting and analytics.
Use Cases
This remove_from_cart
implementation supports:
- Cart abandonment analysis
- Product friction detection
- Retargeting users with specific product interest
- Improving checkout UX and flow