SC_SEARCH_WIDGET_CLICK events
The SC_SEARCH_WIDGET_CLICK event tracks when the site visitor clicks a Sitecore Search widget in your app, such as an item, facet, or suggestion. You can set up this event when you're implementing a Sitecore Search widget.
You can send SC_SEARCH_WIDGET_CLICK events by using the event function and passing it the event data object.
The event data object
The event data object represents all the required and optional data about the event.
This is the object where you provide data about the event. All this data is sent to Sitecore, so make sure to provide the correct data depending on your organization's requirements. Construct the object in the following way:
-
Set the type of the event to
SC_SEARCH_WIDGET_CLICK. -
Provide the search data object to capture Sitecore Search data about the event.
NoteRefer to the Sitecore Search Events API reference and data model to construct search data objects.
Examples
During development, use your web browser's developer tools to check the payload containing all the event data that is sent to Sitecore.
Here's an example event data object for a SC_SEARCH_WIDGET_CLICK event. This object describes a click event on an item:
You can send this event by passing the object to the event function:
For this event data object, the following payload is sent to Sitecore:
Here's an example event data object for a SC_SEARCH_WIDGET_CLICK event. This object describes a click event on a facet:
You can send this event by passing the object to the event function:
For this event data object, the following payload is sent to Sitecore:
Here's an example event data object for a SC_SEARCH_WIDGET_CLICK event. This object describes a click event on a suggestion:
You can send this event by passing the object to the event function:
For this event data object, the following payload is sent to Sitecore: