Search results widget events
Sitecore Search JS SDK for React offers events to track interactions with the search results widget.
All attributes are optional unless indicated otherwise.
trackSearchResultsClickEntityEvent
Tracks the click on an entity in the search results container.
Fire this event only if you are not using Search UI components.
|
Name |
Type |
Description |
|---|---|---|
|
|
string |
Required. Identifies the widget being tracked. |
|
|
string |
Required. Type of entity. Example: |
|
|
|
Required. Payload dispatched with the event. |
SearchResultsClickEntityPayload
Payload dispatched with trackSearchResultsClickEntityEvent.
|
Name |
Type |
Description |
|---|---|---|
|
|
array< |
Required. Clicked entity. |
|
|
number |
Required. The index of the clicked entity. |
|
|
string |
Phrase searched. |
|
|
string |
Query search expression to narrow the search. Example: |
|
|
string |
Modified keyword as returned in the results. |
|
|
number |
Maximum number of results to retrieve. |
|
|
number |
Total number of results identified by the search |
|
|
number |
Maximum number of results that appear on one webpage. |
|
|
number |
The number of the page hosting the widget after the results have been paginated using |
|
|
string |
URL of the page the search redirects to. |
EntityPayload
This payload describes an entity. Use this payload type in all events when you want to track interaction with an entity.
|
Name |
Type |
Description |
|---|---|---|
|
id |
number |
Required. ID of the entity. |
|
entityType |
string |
Required. Name of the entity. |
|
url |
string |
URL of the entity page. Typically the detail page of the entity. When not supplied, the SDK uses the URL of the page. |
|
sourceId |
string |
ID of the source of the entity, as assigned by the connector. |
trackSearchResultsFacetClickEvent
Tracks click or selection of a facet in a search results widget.
Fire this event only if you are not using Search UI components.
|
Name |
Type |
Description |
|---|---|---|
|
|
string |
Required. Identifies the widget being tracked. |
|
|
string |
Required. Type of entity |
|
|
|
Required. Payload dispatched with the event. |
SearchResultsFacetPayload
Payload dispatched with trackSearchResultsFacetClickEvent.
|
Name |
Type |
Description |
|---|---|---|
|
|
array< |
Required. Clicked entity. |
|
|
number |
Required. The index of the clicked entity. |
|
|
string |
Phrase searched. |
|
|
string |
Query search expression to narrow the search. Example: |
|
|
string |
Modified keyword as returned in the results. |
|
|
number |
Maximum number of results to retrieve. |
|
|
number |
Total number of results identified by the search |
|
|
number |
Maximum number of results that appear on one webpage. |
|
|
number |
The number of the page hosting the widget after the results have been paginated using |
|
|
string |
URL of the page the search redirects to. |
FacetPayload
This payload object describes a facet.
|
Argument |
Type |
Description |
|---|---|---|
|
|
string |
Required. ID of the facet |
|
|
string |
Required. Title of the facet. |
|
|
number |
Index of the facet in the list of facets received with the search results. |
|
|
string |
ID of the facet value. |
|
|
string |
Index of the facet value in the list of facet values received with the search results. |
|
|
string |
Start or minimum value in the range. |
|
|
string |
End or maximum value in a range. |
|
|
string |
Value of the facet |