Overview: The section explains how to capture information about catalog objects viewed on a website using a Sitemap within the Salesforce Interactions SDK. Catalog objects could be products, services, articles, etc.
Catalog Objects:
These are items like products or articles whose information you want to track when users interact with them.
Namespaces:
SalesforceInteractions Namespace: Uses interaction.catalogObject to capture catalog object information for interactions like ViewCatalogObject.
Evergage Namespace: Uses catalog object for capturing the information.
ID Field:
The id field (or _id in the Evergage namespace) is mandatory when tracking a catalog object. This field uniquely identifies the catalog object.
Returning Promises:
SalesforceInteractions Namespace: A Promise can be returned for every field of the catalog object.
Evergage Namespace: A Promise can be returned for the _id, categories, and relatedCatalogObjects fields.
Event Tracking: The event is tracked only after all Promises resolve. This ensures that all necessary data is available before the interaction is recorded.
Catalog Item Definition:
Catalog items and their attributes must be predefined and enabled in the Personalization UI before being used in a Sitemap. This means setting up and configuring these items within Salesforce's Personalization tool.
Built-in Attributes:
Some attributes like id, name, and description are default attributes for every catalog item.
Custom Attributes:
Additional attributes can be added as needed via the Personalization UI. This allows for customization based on specific business requirements.
Imagine you have an e-commerce website, and you want to track when users view specific products. Here’s how it works:
Setup in Personalization UI:
Define the products (catalog items) and their attributes (e.g., id, name, description, price).
Configuration in Sitemap:
Use the SalesforceInteractions or Evergage namespace to capture these catalog interactions.
Ensure the id field is always provided.
Optionally, use Promises to handle asynchronous data fetching for these fields.
Here's a simplified code snippet to illustrate this process: