Download User Profiles to CSV

User profiles can be downloaded through the Mixpanel UI or alternatively by either a JQL Query or a Python script.

The ability to download to CSV is available on paid plans - visit the pricing page for more information or to upgrade.

Download User Profiles in Mixpanel

To download your user profiles from Explore, simply click the download icon at the top of the list. This will download all of your user profiles. You can choose to filter the list or select individual profiles to download instead of downloading the full list. A link to download the file will be emailed to the email associated with the project.

Screen_Shot_2019-11-14_at_9.09.11_AM.png

Download User Profiles with JQL

Note that downloads using JQL are limited to 2GB, so if you run into issues downloading, try the steps below for the Python script instead, which can handle any size download.

In your Mixpanel project, click on Applications > JQL > Build your own, and remove any pre-populated code that appears.

Then, enter the following query > RUN QUERY, then Download to CSV*:

function main() {
  return People()
}

Learn more about the power of JQL.

Download User Profiles with a Python Script

User profiles can be downloaded through the Mixpanel API. One way to request and execute the download is through a simple Python script. Use the Mixpanel_api repository and reference the download section to find the necessary functions. In order to obtain all of the necessary components of the script:

1. Collect your API credentials by clicking on your initials in the top right of Mixpanel and selecting Profile & Preferences under ACCOUNT SETTINGS.

Screen_Shot_2019-11-14_at_9.23.22_AM.png

Under the Projects tab you can view your API credentials for each project.

2. If you are downloading all of your users, you can ignore cohort parameters. However, if you want to download a subset of users, you'll want grab these two parameters. In order to do this:

  • Go to the "Explore" tab and select the subset of users you would like to download using user properties and/or events.
  • Open Developer Tools and bring focus to the console (On Chrome for Mac: command + option + "J" & on Chrome Windows: control + shift + "J").
  • Refresh the page.
  • From the console, select the Network tab, select XHR, find the "engage" request in the "Name" column, and then select Headers.

Screen_Shot_2019-08-07_at_11.48.42_AM.png

  • Find the 'filter_by_cohort' value.
  • Copy and paste the 'filter_by_cohort' value into the script to target only users in the Explore report.
  • Save the document.

The following code sample is from mixpanel_api import Mixpanel:

filter_by_cohort = ''
m.export_people(query_params=
{'filter_by_cohort' : filter_by_cohort})

3. Execute the script to pull these user profiles into a new JSON file. If you would like this in CSV format, you will want to add the parameter "format = 'CSV'". On a PC, simply open up the script with Python 2.7 to execute it. On a Mac, open up your Terminal and follow the steps below:

 

2015-04-20_18_51_53.586496-People2CSV_05.png

The downloaded file will now be in the same location as the python script, and will include the epoch time stamp for when the download was performed.

Is this article helpful?

Comments

0 comments

Article is closed for comments.