Analytics events endpoint

    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

    POSThttps://edge.meilisearch.com/events

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

    Binding analytics events to a user

    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

    curl \
      -X POST 'https://edge.meilisearch.com/events' \
      -H 'Content-Type: application/json' \
      -H 'Authorization: Bearer DEFAULT_SEARCH_API_KEY' \
      --data-binary '{
        "eventType": "click",
        "eventName": "Search Result Clicked",
        "indexUid": "products",
        "objectId": "0",
        "position": 0
      }'
    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
    }
    

    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
    }