AddToCartEvent
Class
An e-commerce event that represents when a user adds an item to their shopping cart. This class is part of the Salesforce Marketing Cloud Unified SDK and extends CartEvent to provide functionality for tracking add-to-cart actions in e-commerce applications.
Platform: androidJvm
SDK Version: 11.0.0
A list of line items associated with the cart event.
Type: List<LineItem>
Access: Read-only
Inherited from: CartEvent
The event category name. Category contains list of allowed values.
Type: Event.Category
Access: Read/write
Inherited from: EngagementEvent
Priority level for this event.
Type: Priority
Access: Read-only
Inherited from: EngagementEvent
Returns the event attributes for this event.
Returns: Map<String, Any> - A map containing the event’s attributes as key-value pairs.
Inherited from: EngagementEvent
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.
Inherited from: EngagementEvent
Data class that describes purchasable items for Cart & Order events.
| Parameter | Type | Required | Description |
|---|---|---|---|
catalogObjectType | String | Yes | Type name for the catalog object in the line item |
catalogObjectId | String | Yes | Unique identifier for the catalog object |
quantity | Int | Yes | Number of catalog objects in this line item |
price | Double? | No | Price of the catalog object (defaults to null) |
currency | String? | No | Currency for the price field (defaults to null) |
attributes | Map<String, Any> | No | Map of user-supplied values (defaults to empty map) |
| Property | Type | Mutability | Description |
|---|---|---|---|
catalogObjectType | String | Read-only | Type name for the referenced catalog object |
catalogObjectId | String | Read-only | Unique identifier for the referenced catalog object |
quantity | Int | Read-only | Number of catalog objects in the line item |
price | Double? | Mutable | Price of the referenced catalog object |
currency | String? | Mutable | Currency for the price field |
attributes | Map<String, Any> | Mutable | Map of user-supplied values |
- CartEvent - Base sealed class for cart-related events
- RemoveFromCartEvent - Event for when a user removes an item from their shopping cart
- ReplaceCartEvent - Event for when a user replaces their shopping cart with a list of items
- EngagementEvent - Base sealed class for engagement-related events
- EventManager - Manages event tracking (initialized during
SFMCSdk.configurecall) - LineItem - Data class describing purchasable items