Tutorial: Creating your first profile

It should only take a few minutes to create your first People Analytics profile.

Install the Mixpanel JavaScript library

First, install a Mixpanel tracking library. In this example, we'll be using the JavaScript library, but there are many others (such as iOS and Android) for sending data from other platforms.

To install the library, just paste the following code into the <head> section of your HTML page. Make sure to change YOUR_TOKEN to your actual project token, which you can find by clicking your name in the upper righthand corner of your Mixpanel project and selecting Settings from the dropdown.

Create a profile

Mixpanel allows you to tie data to a specific user, creating a profile. This is where you store things like their email address, where they came from, or their age.

In this example, we're going to create a new profile with the properties "$first_name", "$last_name", "$created", and "$email". "$email" is a special property used for messages - special properties have a leading "$". You shouldn't make up your own property names beginning with "$".

It's important to note that you must call mixpanel.identify to actually create a new profile. This flushes data from the client to Mixpanel's servers.

mixpanel.identify("13487");
mixpanel.people.set({
    "$first_name": "Joe",
    "$last_name": "Doe",
    "$created": "2013-04-01T09:02:00",
    "$email": "joe.doe@example.com"
});

Add your tracking code to the page and refresh to create the profile.

Look at your report

At this point, there should be a new record in your Explore report: