This reference describes /events, the endpoint you should use to submit analytics events to Meilisearch Cloud. It also describes the accepted event objects and the data you must include in them.

The /events endpoint

The /events endpoint is only available for Meilisearch Cloud projects with analytics and monitoring activated.

Send an event

POST https://edge.meilisearch.com/events

Send an analytics event to Meilisearch Cloud. Accepts click and conversion events.

By default, Meilisearch associates analytics events with the most recent search of the user who triggered them. Include the same X-MS-USER-ID header in your search and event requests to manually bind analytics events to a user.

Example

Response: 201 Created

The click event object

The click event must deliver an object with the following fields:

{
  "eventType": "click",
  "eventName": "Search Result Clicked",
  "indexUid": "products",
  "objectId": "0",
  "position": 0
}
  • eventType: a string indicating this is a click event
  • eventName: a string describing the event
  • indexUid: a string indicating the clicked document’s index
  • objectId: a string indicating the clicked document’s primary key
  • position: an integer indicating the clicked document’s position in the list of search results

The conversion event object

The conversion event must deliver an object with the following fields:

{
  "eventType": "conversion",
  "eventName": "Product Added To Cart",
  "indexUid": "products",
  "objectID": "0",
  "position": 0
}
  • eventType: indicates this is a conversion event
  • eventName: a string describing the event
  • indexUid: the document’s index
  • objectID: the document’s primary key
  • position: the document’s position in the list of search results