Vero to BigQuery

This page provides you with instructions on how to extract data from Vero 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 Vero

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

Data from Vero is retrieved via HTTP callbacks that you can define. Step one is to set up the webhook in your Vero account. You will provide a url to send the data to and design your script to listen on this URL.

Sample Vero data

Once you’ve set up HTTP endpoints, Vero will begin sending data via the POST request method. You can access useful objects like sent, delivered, opened, clicked, bounced, and unsubscribed. Data will be enclosed in the body of the request in JSON format. Below is a sample of what an inbound webhook with data from the sent endpoint looks like when it comes from Vero.

{
        "sent_at":1435016238,
        "type":"sent",
        "user": {
            "id":123,
            "email":"steve@getvero.com"
        },
        "campaign": {
            "id":987,
            "type":"transactional",
            "name":"Order confirmation",
            "subject":"Your order is being processed!",
            "trigger-event":"purchased item",
            "permalink":"http://app.getvero.com/view/1/341d64944577ac1f70f560e37db54a25",
            "variation":"Variation A"
        }
    }

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 Vero data up to date

So what’s next? You’ve built a script that collects data from Vero and moves it into your data warehouse. What happens when Vero sends a data type that your script doesn’t recognize? Also, consider the situation where an field in Redshift needs to be updated to a new value. For this to be a solution that stays useful for week and months to come, you need this functionality. After that, you can set it up as a cron job or continuous loop.

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 Vero data via the API, structuring it in a way that is optimized for analysis, and inserting that data into your Google BigQuery data warehouse.