SC_SEARCH_WIDGET_VIEW events
The SC_SEARCH_WIDGET_VIEW event tracks when the site visitor views a Sitecore Search widget in your app. This event only triggers when non-empty widgets are viewed. You can set up this event when you're implementing a Sitecore Search widget.
You can send SC_SEARCH_WIDGET_VIEW 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_VIEW. -
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_VIEW event:
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: