Track Personalization Engagement

To power Personalization's advanced machine learning, it's essential to capture and analyze how users interact with your site, especially with personalized content. This continuous data collection helps Personalization better understand user behavior, allowing the system to deliver recommendations that become more accurate and hyper-personalized over time.

User interaction event logs are automatically sent from the Web SDK sitemap to Data Cloud for tracking. This data is crucial for powering machine learning algorithms and for reporting and analytics within Data Cloud. The Data Cloud module processes these structured events by flattening them, assigning an eventType for categorization, and organizing them into data streams. You can even merge multiple event types into a single data stream.

To ensure events are categorized correctly, you must update your Data Cloud Web Schema. The schema defines the structure for event types, including their available fields, required fields, and field names. For more information on the structure of the Data Cloud Web Schema, see Mobile and Web SDK Schema Quick Guide for Data Cloud.

An Engagement Destination is a configuration that determines how user interaction events are processed, categorized, and sent to Data Cloud for analysis. When you configure a personalization experience in the Web Personalization Manager, you can choose a standard, out-of-the-box (OOTB) destination or create a custom one to fit your needs.

For more information on configuring a personalization experience and setting an engagement destination, see Creating a Personalization Experience.

Personalization provides two OOTB destinations for common use cases: Product Engagement and Website Engagement. These destinations use predefined event types to map engagement data to the correct Data Model Objects (DMOs).

Engagement DestinationAssociated Event TypeRecommended DMO
Product EngagementproductEngagementProduct Browse Engagement
Website EngagementuserEngagementWebsite Engagement

Here's an example payload for an engagement categorized with the userEngagement event type and sent to Data Cloud.

While OOTB destinations cover standard scenarios, you may require more control to handle unique tracking requirements or to modify event data. Custom engagement destinations give you granular control over how engagement events are categorized before they're sent to Data Cloud.

To create a custom destination, you add code to your sitemap in a two-step process:

  1. Retrieve the current engagement configuration.
  2. Define and add your custom engagement destination.

First, retrieve the live engagement configuration from the SDK using the SalesforceInteractions.Personalization.Config.Engagement.get function.

This function fetches the current configuration object and stores it in a variable, currentEngagementConfig, making it available for modification.

Once you've retrieved the configuration object, you can define and add your new destination to its destination property. These parameters make up the engagement destination.

label

A user-friendly name for the destination that appears in the Web Personalization Manager UI.

description

A brief explanation of what this destination is used for. You can also use the label as your description.

disableSendingNonItemEngagementEvents

A boolean that, if set to true, denotes that the personalization experience involves recommendations (such as product or article recommendations). If set to false, it denotes manual content being recommended.

eventModifiers

An object containing properties that will override the default values in the engagement event payload. The eventModifiers object accepts these parameters.

type

The type of the item being recommended. This is valid only for personalization experiences based on product recommendations.

event-type

The Data Cloud event type that needs to be mapped to the appropriate DMOs. Ensure that the event type is defined in the Data Cloud web schema and mapped to the correct DMOs.

interaction-name

Specifies the type of interaction that occurred, such as a view or a click. You can also define this as a function where it receives a single context parameter. This context object contains a name property with a string value of either view or click, depending on the user's action. You can use this context.name value within your function to return custom interaction names.

Here’s an example of code to be added to a sitemap configuration to create the example popupEngagement destination.

Use the sendEvent function of the Interactions SDK to send send detailed user interaction data–such as product views, clicks, and engagements with personalized content–back to Data Cloud.

This example shows you how to track views on a personalized product recommendation.

This example shows you how to track clicks on a personalized product recommendation.

Here’s an example of how to track views on a personalized non-product item.

Here’s an example of how to track clicks on a personalized non-product item.