Distinct IDs

This article reflects the behavior of an older version of Mixpanel's identity management system without Identity Merge enabled.

Mixpanel’s distinct_id is a unique identifier that is connected to every event as an event property.

A distinct_id is assigned to every user that is tracked, and it connects all of the events performed by an individual user.  

Mixpanel’s client-side tracking libraries automatically assign a distinct_id to a user when they first visit a website or an application that has Mixpanel installed. Distinct_id should not contain any special characters such as forward slashes, as it will break the URL.

Distinct_ids can and often should be sent in server-side implementations as well.

Distinct_ids are case sensitive.

Distinct_id Role in Reports

The distinct_id plays an important role in determining event count.

While the role that distinct_ids play in building reports does vary, it is always used to tie events to an individual user. The distinct_id is part of calculations in the following reports:

Insights and Formulas

In the Insights and Formulas reports distinct_ids are used to determine uniqueness.

When you filter a report down to look at only uniques, Mixpanel is showing you the count of unique distinct_id values that triggered that event.

When you view averages, it is showing you the average number of events sent per distinct_id per hour/day/week/month.


In the Funnels report, distinct_id is used to follow a given customer through a funnel.

When the report is calculated, we take the count of unique distinct_id values that sent the first event.

We then follow that pool of ids through the subsequent events, calculating the drop off as we go.


In the Retention report, distinct_id is used to follow a cohort of users through time.

When you select a value under "show me users who did X," we collect the entire pool of unique distinct_id values that send that event on the given day/week/month.

We then follow that group of distinct_ids forward in time to see if there are any the events you specified in the following day/week/month long buckets that were sent with that id. If so, we include that id when calculating the percentage that we display for that cell in the chart.

User Analytics 

Distinct_ids play a dual role in user analytics.

Each user profile is indexed by a unique distinct_id, which represents the identity of the user.

User data sent to Mixpanel must include a distinct_id.

If the distinct_id already exists in Mixpanel and has a user profile tied to it, then the incoming user data updates the existing profile.

If the distinct_id does not already exist, a new user profile is created for that distinct_id.

Locating the Distinct_id

Distinct_ids can be obtained in several different reports within Mixpanel.


Mixpanel’s Users report aggregates and organize a collection of User profiles.

The distinct_id is used to both distinguish profiles from one another and to tie events to User profiles.

All events and associated properties that a user performs will be visible in the activity feed.

The distinct_id of a user that performs an event can therefore be obtained from the Users report.

To view distinct_ids from Users:

1- Go to "Users" and select a user profile.


2- The distinct_id(s) of that user will be visible in the left column, under "Distinct ID", but also at the URL of the profile:



"Events" displays events that are being collected by Mixpanel in real-time.

Every event and all of its corresponding properties can be examined in "Events", including the distinct_id associated with every event.

To view distinct_ids from "Events":

Go to "Events" and check the "Distinct ID" column, which indicates the distinct_id of the user who triggered that event:


Bulk Identification of Users

There are many instances where it is necessary to obtain the distinct_ids of a collection of users.

JQL and the Mixpanel export API can be used to collect distinct_ids in bulk based on another identifier (such as a user profile property).


To view or export distinct_ids in bulk, you can leverage JQL, which can be used to query your raw event and user data.

Distinct_ids can be returned with a value, such as email address, by using a query similar to the one in the example below:

// Returns a list of values of distinct_ids and another property
function main() {
 return join(
   from_date: '2018-04-21',
   to_date:   '2018-04-22'
//return only users for which the property is set
 .filter(function(j) {return j.user && j.user.properties.$email})
// group the data by distinct_id, and optionally any other properties
 .groupByUser(["user.properties.$email"], mixpanel.reducer.count())
// return only the distinct_ids, and optionally any other properties
  return {
  "distinct_id": i.key[0],
  "Email": i.key[1]

Use the query below to return only a list of distinct_ids that have fired any event for a particular date range:

// Returns a list of distinct_ids
function main() {
    return Events({
        from_date: '2018-04-21',
        to_date: '2018-04-22'
    .groupBy(['properties.$distinct_id'], mixpanel.reducer.null())
    .map(function(m) {
        return {
            "distinct_id" : m.key[0]
Did this answer your question?



Article is closed for comments.