Commerce Einstein Activity Tracking API
Commerce Einstein product recommendations require activity tracking data. For example, tracking the viewProduct activity provides insight into top-viewed products. The Activity Tracking API provides access to these activities for use in recommendations.
The Commerce Cloud Einstein Recommendation Validator extension helps with preliminary validation when integrating Commerce Einstein Activity Tracking on Salesforce production instances. This extension is available only for the Google Chrome browser. You can search for and install the Commerce Cloud Recommendation Validator extension from the Chrome Web Store.
Trigger the viewProduct activity when a shopper views a Product Detail page. Don’t fire if a product is displayed via a recommendation, search result, or any other means.
If you replace the Product Detail Purchase Options component with a custom component, implement the viewProduct activity to ensure that Commerce Einstein Recommendations use cases generate results based on shopper or buyer view behavior.
Parameters
- product—The product that the customer viewed. An object with an 18-character product ID.
- sku—(Optional) A unique stock keeping unit identifier for the product.
Example usage
Trigger the viewReco activity when a recommendation is displayed to the customer. Implement this activity when building a custom Commerce Einstein recommendations component.
If you calculate a recommendation but don’t show it to the customer—for example, it doesn’t have as many results as you like—don’t fire this activity.
Parameters
- recommenderName—The name of the recommender.
- recoUUID—A string representing the unique ID for this recommendation response.
- products—The products displayed to the customer. A list of one or more 18-character product IDs.
- sku—(Optional) A unique stock keeping unit identifier for the product.
Example usage
Trigger the clickReco activity when a recommended product is clicked and the customer is taken to the product detail page. Implement this activity when building a custom Commerce Einstein recommendations component.
Parameters
- recommenderName—The name of the recommender.
- recoUUID—A string representing the unique ID for this recommendation response.
- product—The product that the customer clicked. An object with an 18-character product ID.
- sku—(Optional) A unique stock keeping unit identifier for the product.
Example usage
Trigger the addToCart activity when a shopper adds a product to the cart.
If you replace the Product Detail Purchase Options component with a custom component, implement the addToCart activity to ensure that Commerce Einstein Recommendations use cases generate results based on shopper or buyer view behavior.
Parameters
- product—The product that the customer adds to cart. An object with an 18-character product ID.
- sku—(Optional) A unique stock keeping unit identifier for the product.
- quantity—(Optional) The total number of this item in the cart.
- price—(Optional) The price of each individual unit of this product.
- originalPrice—(Optional) The original price of each individual unit of this product.
Example usage
See Also