Use Mixpanel as a data source


Connector Type: REST/URL
Authentication Requirements:
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,

  1. Open a new tab in your browser and log in to your Mixpanel account.
  2. From the top right menu, select Account.

  1. Select Projects.
  2. 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):{date.add(-29).format()}&to_date={}&interval=30

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):["Event1","Event2"]&interval=30&type=general&unit=day

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.

For example:["%24Product%20Tour%20%23Start","%24Product%20Tour%20%23End"]&interval=30&type=general&unit=day

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:

  1. Expand the Authentication (Oauth, 2 Step, X-WSSE, or Basic) menu.
  2. At Type, select Basic HTTP Authentication.
  3. At Username enter your API Secret.
  4. At Password, leave the text box blank.
  5. 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.

Related links:

Have more questions? Submit a request