EngagementEvent
Package: com.salesforce.marketingcloud.sfmcsdk.components.events
SDK Version: 11.0.0 (also available in 10.0.0)
Target Platform: androidJvm
EngagementEvent is a sealed class representing engagement events in the Salesforce Marketing Cloud Unified SDK for Android. It extends the Event class and serves as a base class for specific engagement event types.
This is a base class for engagement-related events in the SDK. As a sealed class, it can only be extended within the same module, and all direct subclasses are known at compile time. This provides type safety and exhaustive when expressions when handling different engagement event types.
A sealed class representing cart-related events.
- Subclasses:
AddToCartEvent,RemoveFromCartEvent,ReplaceCartEvent - Property:
lineItems: List<LineItem>- A list of line items associated with the cart event
A sealed class representing catalog-related events.
- Subclasses:
ViewCatalogEvent,ViewCatalogDetailEvent,QuickViewCatalogEvent,ShareCatalogEvent,ReviewCatalogEvent,CommentCatalogEvent,FavoriteCatalogEvent - Property:
catalogObject: CatalogObject- The catalog object associated with this event
A sealed class representing order-related events.
- Subclasses:
PurchaseOrderEvent,PreorderEvent,CancelOrderEvent,ShipOrderEvent,DeliverOrderEvent,ReturnOrderEvent,ExchangeOrderEvent - Property:
order: Order- The order associated with this event
The Event category name. Category contains a list of allowed values from the Event.Category enum.
Related: See Event.Category Enum for available values.
The priority level for this event.
Returns: A map containing the Event attributes for this event.
Description: This method returns a key-value map of all attributes associated with the event. These attributes are used when the event is tracked and sent to the Marketing Cloud.
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.
Description: The event name is a critical identifier that links the SDK event to the corresponding event configuration in Marketing Cloud.
The following methods are inherited from the Event class:
Converts the event to a JSON object representation.
Tracks this Event via EventManager to subscriber EventSubscriber.
Usage Example:
EngagementEvent extends the abstract Event class.
Package: com.salesforce.marketingcloud.sfmcsdk.components.events
id
The event identifier.
producer
Returns the Event Producer Name from the allowed Producer enum values.
attributes()
Returns the Event attributes for this event.
name()
Returns the event name, which must match the Event Name used when creating the event in the Marketing Cloud UI.
An enumeration defining possible category values for sending Events.
Package: com.salesforce.marketingcloud.sfmcsdk.components.events
Declaration:
| Value | Description |
|---|---|
APPLICATION | Application-related events |
ENGAGEMENT | User engagement events |
IDENTITY | Identity-related events |
SYSTEM | System events |
BILLING | Billing-related events |
CUSTOM | Custom event categories |
entries
Returns a representation of an immutable list of all enum entries, in the order they’re declared.
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant. Extraneous whitespace is not permitted.
values
Returns an array containing the constants of this enum type, in the order they’re declared.
An enumeration representing possible Producer values for sending Events.
Package: com.salesforce.marketingcloud.sfmcsdk.components.events
Declaration:
-
Event Name Matching: Ensure the event name returned by
name()exactly matches the Event Name configured in the Marketing Cloud UI. This is critical for triggering the correct actions and automations. -
Event Tracking: Use the
track()method to send the event to Marketing Cloud. The event will be processed by theEventManagerand delivered to registeredEventSubscriberinstances. -
Event Attributes: Implement the
attributes()method to provide all relevant data for your engagement event. This data will be available in Marketing Cloud for segmentation and personalization. -
Event Category: Set the appropriate
categoryvalue from theEvent.Categoryenum to properly classify your engagement event.