Reports that the user removed an item from the cart.

👍

Note

The Remove from Cart event uses the same schema as Add to Cart, except for its dyType property value. Unlike Add to Cart, this event isn't mandatory unless you're using features that rely on Dynamic Yield holding the most up-to-date cart state (currently applicable only to triggered emails and push notifications).

Parameters

  • name: Human-readable name, not used to identify an event type
  • properties: A container for the event properties as specified in the following table:
PropertyDescriptionType
dyTypeMust be "remove-from-cart-v1".String
valueThe total monetary value of the event (item or items added that triggered the event only).
Note that this is not all the items in the cart. See the code example that follows after this table (productId "item-34454", quantity 2, itemPrice 59.13: Value is 118.26. The other item in the cart is not included.)
Float (dollars.cents).

Numbers are rounded to the nearest 0.01. Numbers smaller than 0.005 are rounded down to 0.
currency

Optional, but required for multi-currency sites
The currency used for the valueString
List of supported currencies
productIdThe SKU exactly as it appears in the product feedString
quantityThe number of items removedNumber
cart
Optional, but recommended
The cart's current state, after the removal of the item. Products are ordered from the first added to the cart to the most recent. Object

See the cart property table that follows for details.

Cart object properties:

PropertyDescriptionType
productIdSKU exactly as it appears in the product feedString
quantityNumber of itemsNumber
itemPriceThe price of the item addedFloat in the format: dollars.cents

Example: Implementation via script

DY.API("event", {
  name: "Remove from Cart",
  properties: {
    dyType: "remove-from-cart-v1",
    value: 34.45,
    currency: "any supported currency code",
    productId: "gswefd-34-454",
    quantity: 1,
    size: "XL"
    cart: [{
        productId: "sku-4324-bg",
        quantity: 2,
        itemPrice: 12.34,
      },
      {
        productId: "item-34454",
        quantity: 1,
        itemPrice: 34.45
      }
    ]
  }
});

Example: Implementation via Experience API (server-side)

"events":[
  {
  name: "Remove from Cart",
  properties: {
    dyType: "remove-from-cart-v1",
    value: 68.90,
    currency: "any supported currency code",
    productId: "gswefd-34-454",
    quantity: 2,
    size: "XL"
    cart: [{
        productId: "sku-4324-bg",
        quantity: 2,
        itemPrice: 12.34,
      },
      {
        productId: "item-34454",
        quantity: 1,
        itemPrice: 34.45
      }
    ]
  }
}]