Gorgias logo
Gorgias logo

All articles

SegmentUpdated a year ago

Segment's software and APIs collect, clean, and control your customers' data.

How it works

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.

Setup instructions

First, add Gorgias as a Source to Segment:

  1. In your Segment account, click on "Sources"
  2. Click "Add Source"
  3. 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 "Write Key" under Installation and copy it
  8. Go to http://decodebase64.com/ and paste the "Write Key" value under "ASCII Plain Text"
  9. After pasting the value, make sure you add a colon character (:)  at the end of the string
  10. Copy the resulting 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.

How 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"
1Integration name: Send info to segment on Ticket created
2Description: Segment
3Trigger: Ticket created
4URL: https://api.segment.io/v1/track
5HTTP Method: POST
6Headers: Key: Authorization, Value: Basic "Paste Base64 code from Setup Instructions (step 10) here –without the quotes"
7Request Body (JSON):
8 {
9 "timestamp": "{{ticket.created_datetime}}",
10 "properties": {
11 "subject": "{{ticket.subject}}",
12 "ticket_id": "{{ticket.id}}",
13 "status": "{{ticket.status}}",
14 "assignee": "{{ticket.assignee_user}}",
15 "channel": "{{ticket.channel}}",
16 "name": "{{ticket.customer.name}}",
17 "tags": "{{ticket.tags}}"
18 },
19 "userId": "{{ticket.customer.email}}",
20 "event": "Ticket created"
21 }

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.

Please note: this integration is available to all customers but will only be supported for Advanced and Enterprise plan customers. While any plan can set up the integration following the instructions, due to the manual work it requires on our end, if you are on the Basic or Pro plan we will not be able to provide support in setting it up or fixing any issues with it should they arise.

Was this article helpful?