AppsFlyer to BigQuery

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

About AppsFlyer

AppsFlyer is an attribution stack for mobile marketers. It lets businesses attribute every install of their apps to the marketing campaign and media source that drove that install. It also provides an analytics dashboard that shows which users engage with an app, how they use it, and how much revenue they generate.

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 AppsFlyer

AppsFlyer exposes data through its Pull API, which developers can use to extract information. Each API call, which is made in the form of an https query, must contain the user’s external API Authorization Key, as well as from and to dates that specify the date range of the data requested.

Additional parameters can request information like media source, currency, and specific fields. The parameters must be added to the https query – for example:


https://hq.appsflyer.com/export/com.greatapp/installs_report/v5?api_token=xxxx&from=2017-11-19%2001%3A30&to=2017-11-19%2013%3A30&category=standard&media_source=googleadwords_int&fields=country_code,city

Each successful API query returns a CSV file of data that you can use as an import source to your data warehouse. The query you use will determine what fields you receive.

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.

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