How do Mixpanel's libraries assign unique identifiers by default?

By default, our Javascript, Android, iOS, and Actionscript libraries manage identities for you.

User identification in Mixpanel is handled through a property called "distinct_id". Distinct_id is sent with each event to determine which customer sent the event. All the unique reports in Mixpanel (funnels, retention, uniques in segmentation), depend on distinct_id to follow a single customer. There are some consequences to using our library-issued distinct_ids, and we recommend managing your own user tracking with a system that closely maps to your particular authentication system.

JavaScript

The JS library will automatically issue a distinct_id to each user that loads the library. The JS distinct_id is a random, unique, 54-60 character hash, and is stored in a cookie. The cookie is specific to the domain, browser, computer and instance of Mixpanel (project). If you do not choose to manage distinct_id yourself, each time a user shows up in a new browser, on a new machine, or clears their cookies, they will appear to be a new unique user.

Example ID: 13bbf7943e584-0885c2531-5c793977-3e8000-13bbf7943e64cf

iOS

For iOS users, if our library detects that the application is using the AdSupport.framework, we'll use the IFA (ID for Advertisers). For apps that do not serve ads and do not have the AdSupport.framework included, Mixpanel will default to using the identifierForVendor (IFV) as the distinct_id.

A device's IFA will persist across sessions and app updates unless a user manually resets their advertising identifier within the iOS privacy settings menu. While the IFA remains constant when a user removes and then re-installs the app, the IFV will change with each installation.

IFV & IFA Example ID: C7C37C10-A4C6-4C6B-BAA1-FF77EDF818D5

Android

The Android library automatically create a random unique UUID (variant 2, version 4 from RFC 4122) value for distinct_id.

Since the Android library uses a native object to store the distinct_id value, it will persist across sessions and app updates. Post version 3.0, when a user removes and then re-installs the app, they will get a new distinct_id value.

Example ID: f47ac10b-58cc-4372-a567-0e02b2c3d479

ActionScript

The ActionScript library uses flash cookies to keep track of distinct_id. Much like the JavaScript library, the AS library will issue a unique hash to a user when they first load the library and will continue to send events with that distinct_id until the cookie is not longer present. Users that return on new machines, in new browsers, or clear their flash cookies will appear to be new unique users.

Example ID: FFA24426-FC50-AE87-41E4-EAC0245A5612