ReplaceCartEvent
com.salesforce.marketingcloud.sfmcsdk.components.events
An E-commerce event for when a user replaces their shopping cart with a list of items.
- Target Platform: androidJvm
- SDK Version: 11.0.0
- Available Since: 10.0.0
The ReplaceCartEvent class represents a complete replacement of a user’s shopping cart contents. This event is triggered when the entire cart is replaced with a new set of items, as opposed to incrementally adding or removing individual items (which would use AddToCartEvent or RemoveFromCartEvent respectively).
ReplaceCartEvent extends the sealed class CartEvent, which provides cart-specific functionality for engagement events.
- AddToCartEvent - Event for adding items to the cart
- RemoveFromCartEvent - Event for removing items from the cart
A list of line items associated with the cart event. Each LineItem represents a product or catalog object being replaced in the cart.
The Event category Name. Category contains list of allowed values.
Defines the priority level for this engagement event.
Returns: A map containing key-value pairs of event attributes.
Description: The Event attributes for this event.
Returns: The event name as a String.
Description: 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.
The lineItems property uses the LineItem data class to represent individual products in the cart.
| Property | Type | Description | Mutable |
|---|---|---|---|
catalogObjectType | String | A type name representing the catalog object referenced in the line item | No |
catalogObjectId | String | A unique identifier representing the catalog object referenced in the line item | No |
quantity | Int | The number of catalog objects in this line item | No |
price | Double? | The price of the catalog object referenced in the line item (nullable) | Yes |
currency | String? | The currency for the price field (nullable) | Yes |
attributes | Map<String, Any> | A map of user-supplied values | Yes |
- As
ReplaceCartEventextends the sealed classCartEvent, it can only be instantiated directly using its constructor - The event name returned by the
name()method must correspond to event configurations in the Marketing Cloud UI to trigger associated actions ReplaceCartEventis part of the engagement tracking system and integrates with Salesforce Marketing Cloud for e-commerce analytics- When creating a
ReplaceCartEvent, you must provide a list ofLineItemobjects representing the complete new contents of the cart