Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Spec: Live Chat Events


This guide explains what data should be sent to Segment from Live Chat tools and hence is targeted to partners who send Live Chat data back into Segment rather than targeted to customers themselves. The semantic events detailed below represent the ideal for Live Chat events; not every Live Chat tool supports all of these events or all their properties.


Overview

overview page anchor

Every Live Chat tool is built around the concept of "conversations" between an agent at the company and a customer who has a question.

Each conversation starts when a customer sends their first message. Within the conversation the customer receives and sends messages. In some situations the conversation also has a clearly recognizable end when the customer or agent explicitly indicates the conversation has ended.


The Live Chat category has the following semantic events:

Live Chat Conversation Started

live-chat-conversation-started page anchor

This event should be sent when a customer sends their first message.

Properties

properties page anchor

This event supports the following semantic properties:

PropertyTypeDescription
agent_idStringThe agent's ID.
agent_nameStringThe agent's real name.
agent_usernameStringThe agent's username.
conversation_idStringThe conversation's ID.
conversation_durationNumberThe conversation duration in seconds.
message_idStringThe message's ID.
1
{
2
"userId": "019mr8mf4r",
3
"action": "track",
4
"event": "Live Chat Conversation Started",
5
"properties": {
6
"agent_id": "bce89acdd11901",
7
"agent_name": "Peter Gibbons",
8
"agent_username": "pgibbons",
9
"conversation_duration": 0,
10
"conversation_id": "abd627dbecffc",
11
"message_body": "But my stapler...",
12
"message_id": "beaffc193618cbe"
13
}
14
}

Live Chat Conversation Ended

live-chat-conversation-ended page anchor

This event should be sent when customer or agent explicitly indicates the conversation has ended.

This event supports the following semantic properties:

PropertyTypeDescription
agent_idStringThe agent's ID.
agent_nameStringThe agent's real name.
agent_usernameStringThe agent's username.
conversation_idStringThe conversation's ID.
conversation_durationNumberThe conversation duration in seconds
message_idStringThe message's ID.
1
{
2
"userId": "019mr8mf4r",
3
"action": "track",
4
"event": "Live Chat Conversation Ended",
5
"properties": {
6
"agent_id": "bce89acdd11901",
7
"agent_name": "Peter Gibbons",
8
"agent_username": "pgibbons",
9
"conversation_duration": 203,
10
"conversation_id": "abd627dbecffc",
11
"message_body": "I\'ll... set the building on fire",
12
"message_id": "bcadac1183618cbe"
13
}
14
}

This event should be sent when customer sends a message to the agent.

This event supports the following semantic properties:

PropertyTypeDescription
agent_idStringThe agent's ID.
agent_nameStringThe agent's real name.
agent_usernameStringThe agent's username.
conversation_idStringThe conversation's ID.
conversation_durationNumberThe conversation duration in seconds.
message_idStringThe message's ID.
1
{
2
"userId": "019mr8mf4r",
3
"action": "track",
4
"event": "Live Chat Message Sent",
5
"properties": {
6
"agent_id": "bce89acdd11901",
7
"agent_name": "Peter Gibbons",
8
"agent_username": "pgibbons",
9
"conversation_duration": 45,
10
"conversation_id": "abd627dbecffc",
11
"message_body": "But then they switched from the Swingline to the Boston stapler!",
12
"message_id": "beaffc193618cbe"
13
}
14
}

Live Chat Message Received

live-chat-message-received page anchor

This event should be sent when the customer receives a message from the agent.

This event supports the following semantic properties:

PropertyTypeDescription
agent_idStringThe agent's ID.
agent_nameStringThe agent's real name.
agent_usernameStringThe agent's username.
conversation_idStringThe conversation's ID.
conversation_durationNumberThe conversation duration in seconds.
message_idStringThe message's ID.
1
{
2
"userId": "019mr8mf4r",
3
"action": "track",
4
"event": "Live Chat Message Received",
5
"properties": {
6
"agent_id": "bce89acdd11901",
7
"agent_name": "Peter Gibbons",
8
"agent_username": "pgibbons",
9
"conversation_duration": 98,
10
"conversation_id": "abd627dbecffc",
11
"message_body": "Yeah, uh huh, okay, Milton",
12
"message_id": "beaffc193618cbe"
13
}
14
}