Learn the basics of how the Segment Source integration works.
Who maintains the integration #
The Segment Source integration is built and maintained by Gladly.
Basic scope #
As a push-based integration, Gladly sends Customer, Conversation, Agent, and Topic data to Segment whenever a Conversation is opened or closed. Once configured, data is automatically sent to Segment whenever a Conversation is opened or closed. The data is sent to Segment as a track event, which can later be used for segmentation or data routing.
How the integration works #
Once the Segment Source integration is connected to Gladly, the following details are sent to Segment.
Conversation Created
Field Name | Value |
event | “Gladly Conversation Created” |
userId | Customer’s ID |
timestamp | Conversation Created Timestamp |
agentId | Agent’s ID currently assigned to Conversation |
agentName | Agent’s Name currently assigned to Conversation |
customerName | Customer’s Full Name |
conversationId | Conversation’s ID |
customerAttributes | Customer’s Custom Attributes |
Customer’s Primary Email Address or 1st Email Address if no Primary is selected | |
phone | Customer’s Primary Phone Number in E.164 format or 1st Phone Number if no Primary is selected |
status | Conversation’s Status |
JSON
{
"context": {
"library": {
"name": "unknown",
"version": "unknown"
}
},
"event": "Gladly Conversation Created",
"integrations": {},
"messageId": "<Segment Message ID>",
"originalTimestamp": "2022-07-08T18:46:37.946Z",
"properties": {
"agentId": "<Gladly Agent ID>",
"agentName": "<Gladly Agent Name>",
"conversationId": "<Gladly Conversation ID>",
"customerName" : "<Gladly Customer Name>",
"email": "<Gladly Customer Primary Email>",
"phone": "<Gladly Customer Primary Phone>",
"customAttributes": {
"example": "<Customer Custom Attribute>"
},
"status": "OPEN",
},
"receivedAt": "2022-07-08T18:46:38.486Z",
"timestamp": "2022-07-08T18:46:37.946Z",
"type": "track",
"userId": "<Glaldy Customer ID>"
}
You can validate Conversations are in Segment by selecting your Segment Source and clicking the Debugger tab.
Conversation Closed
Multiple Conversation Closed events may be sent for the same Conversation ID if the Conversation was reopened and closed.
A Conversation Closed event may not be emitted for all Conversations. For example, if a Conversation was Created and the Customer Profile was deleted before closing, the Conversation Closed event will not trigger.
Field Name | Value |
event | “Gladly Conversation Closed” |
userId | Customer’s ID |
timestamp | Conversation Created Timestamp |
agentId | Agent’s ID currently assigned to Conversation |
agentName | Agent’s Name currently assigned to Conversation |
customerName | Customer’s Full Name |
conversationId | Conversation’s ID |
customAttributes | Customer’s Custom Attributes |
Customer’s Primary Email Address or 1st Email Address if no Primary is selected | |
phone | Customer’s Primary Phone Number in E.164 format or 1st Phone Number if no Primary is selected |
status | Conversation’s Status |
topicIds | List of the Conversation Topic IDs |
JSON
{
"context": {
"library": {
"name": "unknown",
"version": "unknown"
}
},
"event": "Gladly Conversation Closed",
"integrations": {},
"messageId": "<Segment Message ID>",
"originalTimestamp": "2022-07-08T18:46:37.946Z",
"properties": {
"agentId": "<Gladly Agent ID>",
"agentName": "<Gladly Agent Name>",
"conversationId": "<Gladly Conversation ID>",
"customerName" : "<Gladly Customer Name>",
"email": "<Gladly Customer Primary Email>",
"phone": "<Gladly Customer Primary Phone>",
"customAttributes": {
"example": "<Customer Custom Attribute>"
},
"status": "CLOSED",
"topicIds": ["<Gladly Topic ID>"]
},
"receivedAt": "2022-07-08T18:46:38.486Z",
"timestamp": "2022-07-08T18:46:37.946Z",
"type": "track",
"userId": "<Glaldy Customer ID>"
}