Brain Session Message Distribution
Access the distribution of Brain sessions with a specific number of user messages. This Query returns how many sessions have exactly 1, 2, 3, ... 10+ user messages.
tip
You can gain insights on how your customers interact with the Brain. You can asnwer questions like "After how many messages do customers ask for a live agent?"
query BrainSessionMessageDistribution(
$accountId: uuid
$deskIds: _uuid
$brainIds: _uuid
$channels: _text
$startDate: timestamp
$endDate: timestamp
$tags: _text
$isContained: Boolean
$isCovered: Boolean
$isTest: Boolean
) {
rows: brain_sessions_message_distribution(
args: {
start_time: $startDate
end_time: $endDate
account_id: $accountId
brain_parent_ids: $brainIds
desk_ids: $deskIds
channels: $channels
tags: $tags
is_contained: $isContained
is_covered: $isCovered
is_test: $isTest
}
) {
one_message
two_messages
three_messages
four_messages
five_messages
six_messages
seven_messages
eight_messages
nine_messages
ten_plus_messages
}
}
Below are some examples of how BrainSessionNumberMessages
can be called.
- Account
- Multiple Brains
- Multiple Tags
- Brains & Tags
- Multiple Brains & Not Contained
- Not Covered
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2023-04-08",
"endDate": "2023-04-17"
}
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c, 99xx33p9-dfab-44e5-9303-9b2bf13f1c94}",
"startDate": "2023-04-08",
"endDate": "2023-04-17"
}
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2023-04-08",
"endDate": "2023-04-17",
"tags": "{vip-user, return-order}"
}
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2023-04-08",
"endDate": "2023-04-17",
"tags": "{vip-user, return-order}",
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}"
}
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c, 99xx33p9-dfab-44e5-9303-9b2bf13f1c94}",
"isContained": "false",
"startDate": "2023-04-08",
"endDate": "2023-04-17"
}
{
"accountId": "991c12a1-cc58-4377-8e37-f72259e9dac1",
"startDate": "2023-04-08",
"endDate": "2023-04-17",
"isCovered": "false"
}
Example Result:
note
The result below shows that 1000 sessions only have 1 user message while the majority of sessions (35000) have three user messages
{
"data": {
"rows": [
{
"one_message": 1000,
"two_messages": 26483,
"three_messages": 35000,
"four_messages": 26687,
"five_messages": 16470,
"six_messages": 9988,
"seven_messages": 5520,
"eight_messages": 3587,
"nine_messages": 1901,
"ten_plus_messages": 3477
}
]
}
}