Search API Connector Documentation
Import Mixpanel Data to Google Sheets
In this guide, we’ll walk through how to import Mixpanel data directly into Google Sheets, using the API Connector add-on for Sheets.
- Before You Begin
- Part 1: Get your Access Token
- Part 2: Get your Project ID
- Part 3: Pull Mixpanel 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 Access Token
- Log into Mixpanel and navigate to Settings > Organization Settings
- Now click Service Accounts > +Add Service Account
- You'll be prompted to select a name, roles, and expiration time for the Service account. Click Create.
- You'll be presented with a modal containing your username and secret. Copy these down.
- One last step: Because the Mixpanel API requires Basic Authentication, we need to encode our authentication info to base 64. You can do this by entering your your credentials in the format
username:secretinto this form (i.e. your username, then a colon, and then your secret).
The encoding script runs in your browser, and none of your credentials are seen or stored by this site.
Part 2: Get Your Mixpanel Project ID
Most of Mixpanel's API endpoints require a project ID, so let's get that now. Click Settings > Project Settings and copy down the Project ID value.
While you're here, also note the value in the Data Residency field. If it says US, your API request URL will start with
https://mixpanel.com while if it says EU, it will start with
Part 3: Get Mixpanel Insights Data in Sheets
You can create a request using any of the endpoints and parameters described in Mixpanel's API documentation. For this example we'll get data from your Insights reports. For this endpoint you'll also need the report's bookmark ID, which can be found from the url:
https://mixpanel.com/report/1/insights#report/your_bookmark_id/example-report. Substitute in your own encoded credentials from part 1 above.
- Request URL:
- If your organization's data residency is in the EU, the API request URL will start with
- Data for Mixpanel's
/insightsendpoint is currently returned in one long row, with each date receiving a unique column. This is due to the structure of the underlying JSON, as each date is a unique JSON key (and unique keys correspond to unique column headers). In the future, API Connector will add an option to restructure Mixpanel's response such that dates can be sorted into rows instead of columns.
Part 4: API Documentation
Official documentation: https://developer.mixpanel.com/reference/overview