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.

ParameterTypeRequiredDescription
catalogObjectTypeStringYesType name for the catalog object in the line item
catalogObjectIdStringYesUnique identifier for the catalog object
quantityIntYesNumber of catalog objects in this line item
priceDouble?NoPrice of the catalog object (defaults to null)
currencyString?NoCurrency for the price field (defaults to null)
attributesMap<String, Any>NoMap of user-supplied values (defaults to empty map)
PropertyTypeMutabilityDescription
catalogObjectTypeStringRead-onlyType name for the referenced catalog object
catalogObjectIdStringRead-onlyUnique identifier for the referenced catalog object
quantityIntRead-onlyNumber of catalog objects in the line item
priceDouble?MutablePrice of the referenced catalog object
currencyString?MutableCurrency for the price field
attributesMap<String, Any>MutableMap 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.configure call)
  • LineItem - Data class describing purchasable items