Segment Integration Toolkit
  • 16 Sep 2022
  • 2 Minutes To Read
  • PDF

Segment Integration Toolkit

  • PDF

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 every time a Conversation is either opened or closed. Once configured, data is automatically sent to Segment every time 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 NameValue
event“Gladly Conversation Created”
userIdCustomer’s ID
timestampConversation Created Timestamp
agentIdAgent’s ID currently assigned to Conversation
agentNameAgent’s Name currently assigned to Conversation
customerNameCustomer’s Full Name
conversationIdConversation’s ID
customerAttributesCustomer’s Custom Attributes
emailCustomer’s Primary Email Address or 1st Email Address if no Primary is selected
phoneCustomer’s Primary Phone Number in E.164 format or 1st Phone Number if no Primary is selected
statusConversation’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 then closed again. 

A Conversation Closed event may not be emitted for all Conversations - for example, if a Conversation was Created and the Customer Profile was deleted prior to closing, the Conversation Closed event will not trigger.

Field NameValue
event“Gladly Conversation Closed”
userIdCustomer’s ID
timestampConversation Created Timestamp
agentIdAgent’s ID currently assigned to Conversation
agentNameAgent's Name currently assigned to Conversation
customerNameCustomer's Full Name
conversationIdConversation's ID
customAttributesCustomer's Custom Attributes
emailCustomer’s Primary Email Address or 1st Email Address if no Primary is selected
phoneCustomer’s Primary Phone Number in E.164 format or 1st Phone Number if no Primary is selected
statusConversation's Status
topicIdsList 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>"
}



Was this article helpful?