1. Events

Search results widget events

Sitecore Discover JS SDK for React offers the following events to track interaction with the search results widget.

trackSearchResultsClickEvent

Tracks the click on a product present on the search results widget.

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.

ArgumentTypeDescription
rfkidstringRequired.

Identifies the Discover widget for which this event is being tracked.
skustringSKU of product being seen in detail.
indexnumberIndex of the product in the list of products.

Default 0.
keywordstringRequired.

Original keyword or search text that user entered in the search box.
modifiedKeywordstringRequired if the response included a modified keyword.

Modified keyword that was returned as part of search response.
contextContextRequired.

Describes the page and context within which this event is fired.
Note

Discover uses keyword and modifiedKeyword to compute analytic metrics like search clicks, click revenue, direct order, and other attribution metrics.

trackSearchResultsFacetClickEvent

Tracks a facet click. Facet type, value, and index are based on the data received from Discover that has been used to build the UI.

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.

ArgumentTypeDescription
rfkidstringRequired.

Identifies the Discover widget for which this event is being tracked.
facetTypestringRequired.

Type of selected facet.

Example, color.
facetValuestringRequired.

Clicked value in the list of values for the selected facet.

Example, red.
valueIndexnumberRequired.

Index of clicked value in the list of values for the selected facet.
facetIndexnumberRequired.

Index of the selected facet in the list of facets.
contextContextRequired.

Describes the page and context within which this event is fired.
If you have suggestions for improving this article, let us know!