Export Gorgias Ticket Contents

Gorgias makes it easy to export a list of your tickets, with information about them, but much harder to export the ticket contents (e.g. each message within the ticket). Here we will export each ticket in human readable form to a separate google doc. We are doing this so that the ticket history can be used by AI tools (we use Notion's AI search) but there are plenty of other reasons to want to export Gorgias tickets in this way. This method uses google sheets, google appscript, make.com, gemini (or any other llm with an api) and a connector between make.com and gorgias. 

Ticket rows are copied across to a new google sheet as tickets go through the process, so you can easily see which ones have been done. You can stop or start the process, and easily delete ticket rows from the original google sheet which partially functions as a queue.


Costs - roughly 0.6¢ to 1¢+ per ticket as well as a $22 per month subscription
Make.com charges roughly 0.11¢ per credit (although first 1000 per month are free), this method uses 3 per ticket, plus 2 for every message in the ticket.
An llm costs anywhere from 3¢ to $7 per 1000 calls of roughly this type (depends on the model)
The connector between make.com and gorgias we use in this guide costs €19 per month.

 

Guide

Get the list of all the tickets you want to export from Gorgias (you can find instructions on how to do it here), then open it in Google Sheets.

Create an empty second sheet in the same document, copying the header row across.

Go to Google Appscript and create a new project, then copy and paste the code below:

See the Pen Appscript for Gorgias Export by Luke S (@Luke-S-the-typescripter) on CodePen.

You will need to manually add the google sheets id (can be found in the google sheets url, between 'd/' and '/edit').

Now to set things up on the make.com end. Create an account there and chose a plan/payment option.

Then create an account at the provider of the make.com to gorgias connector here, and pay for the 'Essential Apps Access' plan (€19 per month) and add the gorgias connector to your make.com account.

Go to back to make.com and create a new scenario. Then add the following modules, webhook (custom webhook), google docs (create a document), gorgias (list ticket messages), gemini AI (generate a response) - or your preferred llm then google docs (insert a paragraph). There are currently two gorgias community integrations on make.com, use the one with the same logo as in the photos.

Once you have added the webhook, copy the webhook address to clipboard, and paste it into the google appscript project where it says to add the webhook link, before saving the project. Then select 'copyNextRow' from the dropdown and then click run - this will let the webhook in make.com know the structure of the data coming over.

 

 

When setting up the create a document step, you can decide how you would like the google docs to be named (here they are named by the ticket number) and saved. In this setup we have also added a link to the gorgias ticket at the top of the google doc, before the messages.

Make sure you use the right gorgias connector (with the same logo). You'll need to include your gorgias account email address, your gorgias api and your startintegrate api key to setup the connection.

You can setup a gemini api account and get an api key here. Using gemini 2.5 pro is overkill, would make more sense to use flash (quicker and cheaper). The prompt we are using is:
'Please format the following JSON into human readable text. Return only the human readable text.' - this seems to work fine but is not necessarily the best.


This last step just adds the output from gemini to the google doc, so that all the messages for the same ticket are in the same google doc.

Now you can run things by either going into the google sheet and running the 'start 1-minute copying' or by running 'createTrigger' in appscript.


This will copy one row across every minute and send the ticket number to the make.com webhook, creating a google doc with all the ticket message contents.

If you want to speed things up, you can edit the 'ROWS_PER_MINUTE' variable, save the project and run it again.

Back to blog

Leave a comment

    1 out of ...