Drip to BigQuery

This page provides you with instructions on how to extract data from Drip and load it into Google BigQuery. (If this manual process sounds onerous, check out Stitch, which can do all the heavy lifting for you in just a few clicks.)

What is Google BigQuery?

Google BigQuery is a data warehouse that delivers super-fast results from SQL queries, which it accomplishes using a powerful engine dubbed Dremel. With BigQuery, there's no spinning up (and down) clusters of machines as you work with your data. With all of that said, it's clear why some claim that BigQuery prioritizes querying over administration. It's super fast, and that's the reason why most folks use it.

Getting data out of Drip

The first step for getting your Drip data into your data warehouse is collecting that data from Drip’s servers. You can do this using Webhooks. Documentation for Drip Webhooks integration can be found here.

Data from Drip can be retrieved via user-defined HTTP callbacks. The first thing you need to do is set up the webhook in your Drip account. After that you need somewhere to send the data. This could be a special URL that your script listens to.

Sample Drip data

Once you’ve set up HTTP endpoints, Drip will begin sending data via the POST request method. Data will be enclosed in the body of the request in JSON format. Below is a sample of what that data looks like when Drip sends data from the subscriber endpoint.

{
  "id": "z1togz2hcjrkpp5treip",
  "status": "active",
  "email": "john@acme.com",
  "custom_fields": {
    "name": "John Doe"
  },
  "tags": ["Customer", "SEO"],
  "time_zone": "America/Los_Angeles",
  "utc_offset": -440,
  "created_at": "2013-06-21T10:31:58Z"
  "ip_address": "123.123.123.123",
  "user_agent": "Mozilla/5.0",
  "lifetime_value": 2000,
  "original_referrer": "https://google.com/search",
  "landing_url": "https://www.drip.co/landing",
  "prospect": true,
  "base_lead_score": 30,
  "lead_score": 65,
  "user_id": "123"
}

Preparing Drip data

With the JSON in hand, you now need to map all those data fields into a schema that can be inserted into your database. This means that for each value in the response, you need to identify a predefined data type (i.e. INTEGER, DATETIME, etc.) and build a table that can receive them.

The Drip documentation can give you a good sense of what fields will be provided by each endpoint, along with their corresponding data types.

Loading data into Google BigQuery

Google Cloud Platform offers a helpful guide for loading data into BigQuery. You can use the bq command-line tool to upload the files to your awaiting datasets, adding the correct schema and data type information along the way. The bq load command is your friend here. You can find the syntax in the bq command-line tool quickstart guide. Iterate through this process as many times as it takes to load all of your tables into BigQuery.

Keeping Drip data up to date

So what’s next? You’ve built a script that collects data from Drip and moves into your data warehouse. What happens when Drip sends a data type that your script doesn’t recognize? It’s also important to consider the situation where an entry in Redshift needs to be updated to a new value. You'll need to build in that functionality. After that, set your script up as a cron job or continuous loop to keep pulling new data as it is posted by Drip.

Other data warehouse options

BigQuery is really great, but sometimes you need to optimize for different things when you're choosing a data warehouse. Some folks choose to go with Postgres or Redshift, which are two RDBMSes that use similar SQL syntax. If you're interested in seeing the relevant steps for loading this data into Postgres or Redshift, check out To Redshift and To Postgres.

Easier and faster alternatives

If all this sounds a bit overwhelming, don’t be alarmed. If you have all the skills necessary to go through this process, chances are building and maintaining a script like this isn’t a very high-leverage use of your time.

Thankfully, products like Stitch were built to solve this problem automatically. With just a few clicks, Stitch starts extracting your Drip data via the API, structuring it in a way that is optimized for analysis, and inserting that data into your Google BigQuery data warehouse.