|API Documentation:||Mixpanel Data Export API|
Creating a data source using Mixpanel
To create a data source using Mixpanel, you need to accomplish the following tasks:
- Start the data source creation process.
- Retrieve your API Secret from Mixpanel.
- Retrieve any ID numbers or names relevant to your query from Mixpanel.
- Use Mixpanel API documentation to craft a query.
- Use your query to get Mixpanel data in Klipfolio.
Note: This guide assumes that you already have an active Mixpanel account.
Step 1: Start the data source creation process
To create a data source using Mixpanel, go to the New Data Source page in Klipfolio and select Mixpanel.
Step 2: Find your Mixpanel API Secret
To authenticate with Mixpanel, you will need to use your Mixpanel API Secret. To find your API Secret,
- Open a new tab in your browser and log in to your Mixpanel account.
- From the top right menu, select Account.
- Select Projects.
- Copy and save your API Secret.
Step 3: Use Mixpanel documentation to craft a query
Mixpanel offers a variety of query options from which you can retrieve data. Refer to the Mixpanel Data Export API to find out more.
A great way to get started is to copy the query examples below into Klipfolio Dashboard and fill in the blanks with your information. Then, try creating your own queries.
Here are a few sample queries to get you started:
Get data for a funnel (past 30 days):
For this example query, you will also need your funnel ID. To find your funnel ID, in Mixpanel:
- Open the Funnel you would like to retrieve data from.
- Navigate to the URL and copy the Funnel ID and paste it into your query.
Get data for specific events (past 30 days):
For this example query, replace event names, for example Event1 with an event name in your Mixpanel account.
URL encoded events
Important! Sometimes events contain special charactes like #,~,* etc. If that's the case, you may have to URL encode the event names.
Where, from the query above, the event names without URL encoding are:
Event1 : $Product Tour #Start
Event2 : $Product Tour #End
Complete the data source creation process
Now that you have crafted your query:
- Expand the Authentication (Oauth, 2 Step, X-WSSE, or Basic) menu.
- At Type, select Basic HTTP Authentication.
- At Username enter your API Secret.
- At Password, leave the text box blank.
- Click Submit.
Note: In addition to your unmodelled data source, you can create a modelled version of your data source at this stage. To create a modelled data source, ensure that the checkbox next to Model this data source is selected before clicking Continue.
To learn more about creating a modelled data source, click here.