An abstract base class representing events in the Salesforce Marketing Cloud Unified SDK. This class provides the foundation for tracking and managing events within the SDK.
Declaration
1abstract class Event
Inheritance
Known Subclasses:
EngagementEvent
Constructors
Event
1constructor()
Default constructor for creating an Event instance.
Properties
id
1@JvmField2val id: String
Unique identifier for the event.
category
1open val category: Event.Category
The Event category name. See Category enum for allowed values.
producer
1open val producer: Event.Producer
The Event producer name. See Producer enum for allowed values.
Methods
name
1abstract fun name(): String
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.
attributes
1abstract fun attributes(): Map<String, Any>
Returns: A map of attribute key-value pairs
Description: The Event attributes for this event.
toJson
1fun toJson(): JSONObject
Returns: A JSONObject representation of the event
Description: Converts the event to JSON format.
track
1fun track()
Description: Method to track this Event via EventManager to subscriber EventSubscriber.
Nested Types
Category
1enum Category : Enum<Event.Category>
List of possible Category values for sending Events.
Enum Values
Constant
Description
APPLICATION
Category for application-related events
ENGAGEMENT
Category for engagement-related events
IDENTITY
Category for identity-related events
SYSTEM
Category for system-related events
BILLING
Category for billing-related events
CUSTOM
Category for custom events
Properties
entries: EnumEntries<Event.Category> - Returns an immutable list representation of all enum entries in declaration order
Methods
valueOf(value: String): Event.Category - Returns the enum constant matching the specified name
values(): Array<Event.Category> - Returns an array containing all enum constants in declaration order
Producer
1enum Producer : Enum<Event.Producer>
List of possible Producer values for sending Events.
Enum Values
Constant
Description
CUSTOMER_APP
Application-level producer
UNIFIED_SDK
Unified SDK producer
MCE_MODULE
MCE module producer
DC_MODULE
DC module producer
MAM_MODULE
MAM module producer
PUSH_FEATURE_MODULE
Push feature module producer
IAM_FEATURE_MODULE
IAM feature module producer
Properties
entries: EnumEntries<Event.Producer> - Returns an immutable list representation of all enum entries in declaration order
Methods
valueOf(value: String): Event.Producer - Returns the enum constant matching the specified name
values(): Array<Event.Producer> - Returns an array containing all enum constants in declaration order