RemoveFromCartEvent
Class
com.salesforce.marketingcloud.sfmcsdk.components.events
An E-commerce event for when a user removes an item from their shopping cart.
- Target: androidJvm (Android/JVM)
- SDK Version: 11.0.0
- Module: SFMC SDK v3.1.0
RemoveFromCartEvent is part of the Salesforce Marketing Cloud Unified SDK’s event tracking system for e-commerce applications. This event should be tracked when a user removes one or more items from their shopping cart. The event extends CartEvent and inherits all cart-related event functionality.
A list of line items representing the items being removed from the cart. Each line item describes a purchasable catalog object with quantity and optional pricing information.
The Event category name. Contains a list of allowed values that classify the event type.
Defines the priority level of the event for processing and handling by the SDK.
Returns the event attributes as a map of key-value pairs associated with this event.
Returns: Map<String, Any> - A map containing the event attributes
Returns the name for the event. This value must match the Event Name used when creating the event in the Marketing Cloud UI for any action to result from tracking this event.
Returns: String - The event name
Line items describe purchasable items for Cart and Order events.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
catalogObjectType | String | Yes | - | Type name for the referenced catalog object |
catalogObjectId | String | Yes | - | Unique identifier for the referenced catalog object |
quantity | Int | Yes | - | Number of catalog objects in the line item |
price | Double? | No | null | Price of the referenced catalog object |
currency | String? | No | null | Currency code for the price field |
attributes | Map<String, Any> | No | mapOf() | User-supplied key-value pairs |
To track when items are removed from a cart, create a RemoveFromCartEvent with the appropriate line items and track it using the SDK’s event tracking system.
AddToCartEvent- E-commerce event for when a user adds an item to their shopping cartReplaceCartEvent- E-commerce event for when a user replaces their shopping cart with a list of items
- CartEvent - Parent sealed class for cart-related events
- EngagementEvent - Base sealed class for engagement events
- Events Package - Complete events package documentation
- The event name must match the configuration in the Marketing Cloud UI to trigger associated actions
- Line items support custom attributes for additional metadata
- All cart events inherit from the sealed
CartEventclass, ensuring type safety at compile time - Events are processed according to their priority level