Send an event
Send an analytics event to Meilisearch.Body
| Name | Type | Required | Description |
|---|---|---|---|
eventType | String | Yes | The event type: "click" or "conversion" |
eventName | String | Yes | A descriptive label for the event |
indexUid | String | Yes | The index containing the document the user interacted with |
userId | String | Yes | An arbitrary string identifying the user who performed the action |
queryUid | String | Recommended | The search query’s UID. Links the event to a specific search query |
objectId | String | Recommended | The document’s primary key value |
position | Integer | Recommended | The document’s position in the search result list (0-based). Only relevant for click events |
objectName | String | No | A human-readable description of the document |
You must provide a string identifying your user if you want Meilisearch to track conversion and click events.You may do that in two ways:
- Specify the user ID in the payload, using the
userIdfield - Specify the user ID with the
X-MS-USER-IDheader with your/eventsand search requests
Example
Response: 201 Created
Next steps
Get started with analytics
Set up analytics and start collecting search data.
Bind events to a user
Associate analytics events with specific users for accurate tracking.
Track click events
Configure your application to send click events to Meilisearch.