If you’re familiar with IFTTT.com and the simple “If This Then That” task automation “recipes”, then you already also have a pretty good idea how Zapier’s trigger-response mechanism works: you perform a simple manipulation in one web app, and this triggers a response or behavior in another.
What you probably didn’t know is that, using webhooks, you can do a simple data import to Arm Treasure Data. Given Zapier’s hundreds of integrations, a “Zap” containing a webhook to Treasure Data’s REST API opens the door to numerous self-service integrations between any of these data sources and Treasure Data.
While this integration should not replace a full-fledged import to Treasure Data’s Data Engineering as a Service using one of our Data Connectors, it does serve as a good basis for modelling your data or building exploratory queries and analysis on data sources that are not yet supported.
Are you working in an organization where some folks are still keeping data in spreadsheets and want a quick an easy way to use their data in your analytics pipeline?
In this tutorial, we’ll demonstrate this with a simple integration between Google Sheets and Treasure Data using a Zapier Zap.
Let’s get started! We’ll need a few things:
- A Google Docs account;
- A Treasure Data account and your Treasure Data Write API key. We recommend you also install Treasure Data Toolbelt.
- A Zapier account. For our purposes, the free basic plan will do.
Set up your Google Sheet
Set up a Google Sheet as you normally would (for use as a data table). Be sure to include a header row at the top.
Set up your Treasure Data Database and Table
This is most easily done from the command line using TD Toolbelt.
Set up your Zapier Zap
- Select your Google Sheets account. Click ‘test’ and ‘Save + Continue’.
- Select the Spreadsheet and Worksheet you want to pull data from. Click ‘Save + Continue.’
- On the next screen, after you’ve added a row of data to your spreadsheet, click ‘Fetch + Continue’.
- Next, select as your ‘Action’ app.
- Choose ‘Post’ action. Hit ‘Save + Continue’.
- Enter the following information
Or, if you prefer, you can also store the query itself in a text file, and call it from the CLI (accessing results by job ID, as above).