Custom Analytics

Once a chat session has started, you can add custom event analytics against a conversation for tracking additional custom data / events beyond the core assessment. Before being able to call the API to initiate a search, you will need to have an active chat session (login using your API key and token) in order to pass the bearer token in subsequent calls to the API.

Once you have the bearer token, the Analytics API endpoint can be called to add your custom event / data against the assessment.

POST https://portal.your.md/v4/analytics

The payload for the POST request is shown below.

{
    "conversation": {
        "id": "{{CONVERSATION_ID}}"
    },
    "event_id": "start_selection_step",
    "event_payload": {
        "channel": "logged in via app",
        "option_selected": "physiotherapy"
    }
}

Parameters

Parameter nameDescription
conversation.idThis is the conversation ID that is returned when you first start a chat session. Note: it is important to use a valid conversation ID in order to connect the additional data to the correct assessment.
event_idAn ID you want to assign for this event / piece of data. This cannot be empty or null.
event_payloadThe JSON structure containing the data / event you wish to store against the assessment.