Search API Connector Documentation
Import AppsFlyer Data to Google Sheets
In this guide, we’ll walk through how to pull data from the AppsFlyer Cohort Reporting API directly into Google Sheets, using the API Connector add-on.
We’ll first get an API key from AppsFlyer, and then set up a request to pull in metrics to your spreadsheet.
- Before You Begin
- Part 1: Get your AppsFlyer API Token
- Part 2: Create your API Request URL
- Part 3: Pull AppsFlyer API Data into Sheets
- Part 4: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Get Your AppsFlyer API Token
- Reach out to your CSM to enable the Cohort API
- Get the token in the dashboard as shown here:
- From the menu bar, access the user menu (email address drop-down).
- Select Security center.
- In the AppsFlyer API tokens section, click Manage your AppsFlyer API tokens.
- The available tokens (V1.0, V2.0, or both) are displayed.
- Copy the required token.
Part 2: Create Your API Request URL
For this example, we’ll fetch data about a cohort.
- Base domain: https://hq1.appsflyer.com/
- Endpoint: /api/cohorts/v1/data/app/YOUR_APP_ID
- Query parameters: ?format=json
Putting it all together, we get the full API Request URL:
Note: the app ID is the ID in the URL of a store’s app page. For Android, this will look like com.coolcompany.coolapp, while for iOS it will look something like id123456789.
Part 3: Pull AppsFlyer API Data into Sheets
Now let’s get that data into Sheets.
- Open up Google Sheets and click Extensions > API Connector > Open.
- In the Create tab, choose the POST method
- Now enter the Request URL we just created
- We don’t need OAuth authentication, so leave that as None.
- Under Headers, enter three key-value pairs:
- Key = Authorization, Value = Bearer YOUR_TOKEN, using the cohort API token you got from your company dashboard
- Key = Content-Type, Value = application/json
- Key = Accept, Value = application/json
- Under the request body, add in your request parameters like this:
"from": "2020-01-01", "to": "2020-01-31",
"period": [ 0, 1, 2, 10, 30, 60 ],
"pid": ["Facebook Ads","gooleadwords_int"]},
"kpis": ["sessions"] }
- The whole thing should look like this:
- Create a new tab, give it a name, and click Set current to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see your AppsFlyer cohort API data populate your Google Sheet.
Part 4: API Documentation
Official API documentation: https://support.appsflyer.com/hc/en-us/articles/360004799057-Cohort-API#cohort-reporting-api