1. Events

Entity view events

Version:

The entity view event tracks when the site visitor views the details of an index document they searched for in your app. For example, the product details page for a pair of shoes the site visitor clicked in the search results.

You can send entity view events by using the entityView function and passing it the entity view event data object.

The entity view event data object

The entity view event data object represents all the required data about the event.

This is the object where you provide data about the event. All this data is sent to Sitecore Search, so make sure to provide the correct data depending on your organization's requirements. Construct the object in the following way:

  • Provide data about the entity that was viewed and the URI where the event triggered.

  • Optionally, you can provide data such as the channel and the language of the page where the event triggered.

Examples

Tip

During development, use your web browser's developer tools to check the payload containing all the event data that is sent to Sitecore.

Example 14. Sending an entity view event

Here's an example event data object for an entity view event. The object contains all the required event data. You can send this event by passing the object to the entityView function:

For this entity view event data object, the following payload is sent to Sitecore:

{
  "browser_id": "a38b230c-11eb-4cf9-8d5d-274e9f344925​",
  "channel": "WEB",
  "client_key": "",
  "currency": "EUR",
  "language": "EN",
  "page": "/detail-page/1",
  "pos": "",
  "requested_at": "2026-01-13T12:19:57.316Z",
  "sc_search": {
    "data": {
      "value": {
        "context": {
          "page": {
            "uri": "/detail-page/1"
          }
        },
        "entities": [
          {
            "entity_type": "product",
            "id": "1"
          }
        ]
      }
    },
    "metadata": {
      "ut_api_version": "1.0"
    }
  },
  "type": "VIEW"
}


If you have suggestions for improving this article, let us know!