Using the Events API to track events
As visitors interact with your page by clicking on widgets, logging in, upvoting articles, and so on, you must track those interactions and send them to Sitecore Search using the Events API.
Sitecore Search uses events for generating analytic dashboards and driving personalization. If you track events thoroughly and accurately, you get more useful site analytics, and your site visitors get more personalized content.
To track visitor interactions, you must correctly construct the associated event object, call the Events API, and send the object using the API.
You must send certain events for Search to work as expected.
Event types and required attributes
You can track many different types of events using the Sitecore Search Events API. Sitecore Search provides event actions and names that can be combined to create a variety of events.
Sitecore Search supports the following categories of events:
-
Funnel events - visitor actions that you want to track but which do not directly involve a Sitecore Search component. Funnel events include actions such as viewing a page, adding a review, removing a bookmark, logging in, and so on.
-
Widget events - visitor actions on Sitecore Search widgets. These events include widget view and widget click events.
For the event object data model, see the Events API reference.
The following lists the required attributes for all event objects:
Different events have different required attributes in addition to the following. See the individual event types for the required attributes.
Name |
Type |
Description |
Values |
---|---|---|---|
|
string |
Verb describing the action the user takes to cause the event to fire. Used with |
Note You can also use a verb describing a custom event. |
|
string |
Name of the event. Used with |
Values depend on accompanying |
|
string |
Anonymous ID that you generate to track visitors. Note Either |
n/a |
|
string |
Optional user ID that you use in your system. This is different from the Note Either |
n/a |
|
object |
Object including details about the event and the visitor. |
n/a |
|
object |
Context object including more information about the user, browser, location, and page. |
n/a |