ViewCatalogEvent

Package 

1com.salesforce.marketingcloud.sfmcsdk.components.events

Description 

An event to capture when a user views a catalog object.

Class Declaration 

1class ViewCatalogEvent : CatalogEvent

Platform 

  • Target: androidJvm
  • SDK Version: SFMC SDK v3.1.0 (Salesforce Marketing Cloud Unified SDK 11.0.0)

Inheritance Hierarchy 

1Event (interface)
2  └── EngagementEvent (sealed class)
3        └── CatalogEvent (sealed class)
4              └── ViewCatalogEvent (class)

Overview 

ViewCatalogEvent is a concrete implementation of CatalogEvent used to track when a user views a catalog object in your application. This event is part of the engagement tracking system in the Salesforce Marketing Cloud SDK.

Inherited Properties 

From CatalogEvent 

catalogObject 

1val catalogObject: CatalogObject

References the catalog item associated with the event.

From EngagementEvent 

category 

1open override var category: Event.Category

The Event category Name. Category contains list of allowed values.

priority 

1open override val priority: Priority

Defines the priority level for this event.

Inherited Methods 

From EngagementEvent 

attributes() 

1open override fun attributes(): Map<String, Any>

The Event attributes for this event.

Returns: A map containing string keys and any-type values representing event attributes.

name() 

1open override fun name(): String

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 representing the event name.

Related Classes 

CatalogObject 

Represents various items that can be tracked (e.g., a product, a blog post, etc.).

Constructor:

1class CatalogObject @JvmOverloads constructor(
2    val type: String,
3    val id: String,
4    val attributes: Map<String, Any> = mapOf(),
5    val relatedCatalogObjects: Map<String, List<String>> = mapOf()
6)

Parameters:

  • type (String): A type name representing the catalog object. Required.
  • id (String): A unique id representing the catalog object. Required.
  • attributes (Map<String, Any>): A map of user-supplied values. Default: empty map.
  • relatedCatalogObjects (Map<String, List>): A map of related catalog objects. Default: empty map.

Sibling Classes 

Other catalog event types that extend CatalogEvent:

  1. ViewCatalogDetailEvent - Tracks detailed catalog item views
  2. QuickViewCatalogEvent - Tracks quick preview interactions
  3. ShareCatalogEvent - Tracks catalog sharing actions
  4. ReviewCatalogEvent - Tracks review submissions
  5. CommentCatalogEvent - Tracks comment interactions
  6. FavoriteCatalogEvent - Tracks favoriting/bookmarking actions

Usage Context 

This event is part of the engagement tracking system, allowing applications to monitor and report user interactions with catalog items in Marketing Cloud campaigns. Events are tracked using the EventManager after SDK initialization via SFMCSdk.configure.

Notes 

  • The @JvmOverloads annotation on CatalogObject generates multiple constructor overloads for Java interoperability
  • All CatalogObject properties are immutable (val)
  • ViewCatalogEvent is a sealed class subtype, meaning it can only be extended within its own module
  • The event name used when tracking must match the Event Name configured in the Marketing Cloud UI for any action to trigger