CatalogEvent

Package: com.salesforce.marketingcloud.sfmcsdk.components.events

SDK Version: 11.0.0

Platform: androidJvm


Overview 

A sealed class representing catalog-related engagement events in the Salesforce Marketing Cloud Unified SDK. This class is used to track user interactions with catalog objects such as products or blog posts.

Declaration 

1sealed class CatalogEvent : EngagementEvent

Hierarchy 

  • Extends: EngagementEvent

Properties 

catalogObject 

1val catalogObject: CatalogObject

The catalog object associated with this event.


Inheritors 

The following classes inherit from CatalogEvent:

  • ViewCatalogEvent - Records when a user examines a catalog object
  • ViewCatalogDetailEvent - Records when a user views detailed information about a catalog object
  • QuickViewCatalogEvent - Records when a user performs a quick view of a catalog object
  • ShareCatalogEvent - Records when a user shares a catalog object
  • ReviewCatalogEvent - Records when a user reviews a catalog object
  • CommentCatalogEvent - Records when a user comments on a catalog object
  • FavoriteCatalogEvent - Records when a user favorites a catalog object

Companion Object 

1object Companion

A companion object for the CatalogEvent class.


Related Classes 

CatalogObject 

Package: com.salesforce.marketingcloud.sfmcsdk.components.events

A catalog object that represents various items that can be tracked, such as products or blog posts.

Constructor 

1@JvmOverloads
2constructor(
3    type: String,
4    id: String,
5    attributes: Map<String, Any> = mapOf(),
6    relatedCatalogObjects: Map<String, List<String>> = mapOf()
7)
Parameters
ParameterTypeDescriptionDefault
typeStringA type name representing the catalog objectRequired
idStringA unique id representing the catalog objectRequired
attributesMap<String, Any>A map of user-supplied valuesmapOf()
relatedCatalogObjectsMap<String, List<String>>A map of related catalog objectsmapOf()

Properties 

attributes
1val attributes: Map<String, Any>

A map of user-supplied values.

id
1val id: String

A unique id representing the catalog object.

relatedCatalogObjects
1val relatedCatalogObjects: Map<String, List<String>>

A map of related catalog objects.

type
1val type: String

A type name representing the catalog object.


Usage Example 

1// Create a catalog object
2val catalogObject = CatalogObject(
3    type = "product",
4    id = "12345",
5    attributes = mapOf(
6        "name" to "Example Product",
7        "price" to 99.99,
8        "category" to "Electronics"
9    ),
10    relatedCatalogObjects = mapOf(
11        "similar" to listOf("12346", "12347")
12    )
13)
14
15// Create a view catalog event
16val viewEvent = ViewCatalogEvent(catalogObject)