Preview search widget events
Sitecore Discover JS SDK for React offers the event to track interaction with the preview search widget.
trackPreviewSearchClick
Tracks the click on a product in the preview search container. Fire this event only if you are not using the JS SDK for React UI components.
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 | Value |
|---|---|---|---|
rfkid | string | Required. Identifies the Discover widget for which this event is being tracked. | n/a |
sku | string | Required. Identifies the product for which this event is being tracked. | n/a |
index | integer | Position or index of the product that was clicked. Indexing starts from 0. Default: 0 | n/a |
keyword | string | Required. Original keyword or search text that the user entered in the search box Default: "" | n/a |
modifiedKeyword | string | Required. Modified keyword that was returned as part of search response. Default: "" | n/a |
text | string | Required. Text of the link that the user hovers over or clicks. Default: "" | n/a |
targetObjectType | string | Required. Type of suggestion link that the user clicks or hovers over. Default: "" | "TRENDING_CATEGORY", "TRENDING_BRAND", "KEYPHRASE", "CATEGORY", "BRAND" |
w | string | Required. Where in the widget the user clicked. | n/a |
type | string | Required. Event type that is used to identify the event. | "widget" |
Note
Discover uses keyword and modifiedKeyword to compute analytic metrics like search clicks, click revenue, direct order, and other attribution metrics.
If you have suggestions for improving this article, let us know!