Skip to main content
Use /events to submit analytics events such as click and conversion to Meilisearch Cloud.

Send an event

Send an analytics event to Meilisearch Cloud.

Body

NameTypeDefault valueDescription
eventTypeStringN/AThe event type, such as click or conversion, required
eventNameStringN/AA string describing the event, required
indexUidStringN/AThe name of the index of the clicked document, required
queryUidStringN/AThe search query’s UID
objectIdStringN/AThe clicked document’s primary key value
objectNameStringN/AA string describing the document
positionIntegerN/AAn integer indicating the clicked document’s position in the search result list
userIdStringN/AAn arbitrary string identifying the user who performed the action
{
  "eventType": "click",
  "eventName": "Search Result Clicked",
  "indexUid": "products",
  "objectId": "0",
  "position": 0
}
You must provide a string identifying your user if you want Meilisearch Cloud to track conversion and click events.You may do that in two ways:
  • Specify the user ID in the payload, using the userId field
  • Specify the user ID with the X-MS-USER-ID header with your /events and search requests

Example

Response: 201 Created