Segment

Updated 3 weeks ago by Axelle Heems

You can send data about your tickets in Segment by adding Gorgias as a Source on your Segment account. By doing so, you can understand if customers who contacted support in the last year are generating more revenue.

First, add Gorgias as a Source to Segment:

  1. In your Segment account, click on "Sources"
  2. Click "Add Source"
  3. At the end of the list in the server section, click "HTTP API"
  4. Click "Connect"
  5. Type in "Gorgias" as a nickname & SQL schema name, then click "Create source"
  6. Open your newly created Gorgias source
  7. Locate the "Write Key" under installation and copy it
  8. Go to http://decodebase64.com/ and paste the "Write Key" under "ASCII Plain Text"
  9. After pating the "Write Key" make sure you add a colon character or :  at the end of the string.
  10. Copy the text that shows up in the "Base64" section

Nice job! Now you can send data to Segment! Next, we need Gorgias to notify Segment when a ticket is created.

  1. In your Gorgias account, click on "Integrations," then click "HTTP Integration," then click "Add HTTP Integration"
  2. Use the following configuration, and click "Add Integration"
Integration name: Send info to segment on Ticket created
Description: Segment
Trigger: Ticket created
URL: https://api.segment.io/v1/track
HTTP Method: POST
Headers: Key: Authorization, Value: Basic "paste Base64 code from step 9 here - without the quotes"
Request Body (JSON):
{
"timestamp": "{{ticket.created_datetime}}",
"properties": {
"subject": "{{ticket.subject}}",
"ticket_id": "{{ticket.id}}",
"status": "{{ticket.status}}",
"assignee": "{{ticket.assignee_user}}",
"channel": "{{ticket.channel}}",
"name": "{{ticket.requester.name}}",
"tags": "{{ticket.tags}}"
},
"userId": "{{ticket.requester.email}}",
"event": "Ticket created"
}

Congratulations! Every time a ticket is created, data about the ticket will be sent to Segment. You can use the sent data in other apps.


How did we do?