Recommendation widget events
Sitecore Discover JS SDK for React offers the following event to track interaction with the recommendation widget.
trackRecommendationClick
trackRecommendationClick
Tracks the click on a product present on the recommendation widget. Instead of the onNavigationNext and onNavigationPrev actions of the UI component, set the arrow argument to indicate NEXT or PREVIOUS.
Note
Dispatch this event verbosely if you are not using Discover UI components.
When hooked through the JS SDK, Discover UI components handle most user interactions and dispatch events automatically.
| Argument | Type | Description | Values |
|---|---|---|---|
rfkid | string | Required. Identifies the Discover widget for which this event is being tracked. | n/a |
sku | string | Required. SKU of the product the user clicked in a widget. Default "". | n/a |
index | integer | Required. Position of the product or link that the user clicked in a widget. Indexing starts at 0. Default 0. | n/a |
arrow | string | Optional. Used to paginate through list of recommendations. | "NEXT", "PREVIOUS" |
context | Context | Optional. Describes the page and context within which this event is fired. | n/a |
If you have suggestions for improving this article, let us know!