Best Practices -Updated-

Our hope here is to provide a more up to date outline of some of the best practices for quickly getting up and running with mixpanel.

The best way to get started

We advise you begin by instrumenting only a small handful of key metrics. We think you'll be amazed how much value you can get out of even just 5 events. By starting your implementation small, you can quickly separate signal from noise, and begin from day one with a manageable reporting environment that you can share with your co-workers. You'll also be able to start making decisions based on your data faster, allowing the tool to demonstrate its value before additional development time and effort are spent on a more elaborate implementation. Furthermore, a small implementation is also easier to fix if, for instance, after chatting on the phone with a Solutions Architect you decide you'd like to adopt a new system of organizing or naming your events and properties.

One easy way to start small is to envision a single funnel, measuring one of the most important processes on your site or in your app (sign-up, or purchase funnels are good choices). Try choosing the steps of that funnel as your first few events.

Make good use of properties

Properties are the place to articulate all the details associated with an event. Properties fall into two camps: event specific (like the revenue associated with a purchase event) and user specific (like demographic information about the user). The user specific data we call "super properties." For example, you might want to send the gender, age, or traffic source of a particular user along with their events. All the user specific data is stored in a cookie (on the web) or in a local object (on native mobile) and appended onto all subsequent events for that user. A rich set of event and user specific properties will allow added agility in reporting, since mixpanel lets you drill down and inspect the intersections of many different properties across all reporting. It's important to keep in mind that properties are entirely defined by you. Do your best to avoid storing details in event names that could be stored in properties. For example, don't do mixpanel.track("Facebook Share"). Do something like this: mixpanel.track("Share", {"Network": "Facebook"}). More on that here.

Employing this strategy makes Mixpanel's UI and reporting significantly more powerful and easier to understand.

Clear event and property naming

We advise always using clear, human readable event and property names. This makes your reports much easier for everyone on your team to understand. There's no reason you can't use spaces as opposed to underscores if you'd like. Naming things nicely makes reporting more navigable for everyone on your team. For example, don't use us a property name "c_id" for the id associated with a video channel if you don't have to. Why not send us a property called "Channel" and use a plain-text representation of the channel name as opposed to a raw numeric id?

As you continue to expand and improve you mixpanel implementation, keep track of the choices you've made about what to track with an implementation specification. You can can find a sample document to get started with here.

Keep your development data separate from your production data

A common question is "how do we delete some old development data we sent while we were instrumenting?" The answer, unfortunately here, is that you cannot. We advise all customers to create at least two projects. If our project was called "Mixpanel" then we would call one project "Mixpanel - Dev." and the other "Mixpanel - Prod." Use logic in your code to swap out the two project tokens for when you're developing and pushing to production. It costs you nothing extra to have multiple projects as we price based only on the amount of data you send us.

How do I track distinct users and what is this "distinct_id" thing?

One of the most important properties in mixpanel is distinct_id. Distinct_id is a property that is sent with every mixpanel event, and it is what we use to determine uniqueness across all reports. In JS or in the iOS/Android SDKs you can let mixpanel handle distinct_id for you, but you can also choose to control it yourself. You can set distinct_id using the identify method. You can grab distinct_id using mixpanel.get_property("distinct_id") in JS (or the equivalent in our mobile SDKs).

A common question is what to do when an anonymous piece of traffic traverses the signup funnel and then finally converts to a user. If you are setting the distinct_id yourself (to say your internal user id) so that if a registered user comes back on a new machine, or after clearing their cookies, you'd like to keep tracking them as the same user. You may then find yourself changing the distinct_id part way through a funnel, which will break your funnel! And unfortunately there is no way to change the distinct_id of an event that has already been sent to mixpanel. Oh no!

The best practice here is to allow mixpanel's JS library (or mobile SDK) to issue its own automatic distinct_id value to a user when they visit your site. Allow the user to send events from that distinct_id as they traverse the signup funnel. At the time of registration (if you are using mixpanel's JavaScript library v. 2.2 or later) then you can fire mixpanel.alias("whatever_you_aliasing_to") to alias that previous id to your newly issued internal id. From then on, when that user returns and authenticates, ensure that they have the id you just aliased by using mixpanel.register({"distinct_id": "whatever_you_aliased_to"}) or mixpanel.identify("whatever_you_aliased_to"). That way you ensure that the signup funnel does not break, and also that you continue to attribute all post authentication activity to that user, using the same id as originally used in the signup funnel. More on aliasing here.

What is the difference between Engagement data and People data?

The Engagement section of reporting pulls and renders event-based data. The People analytics section pulls and renders People data. Right now these two data types are totally separate from one another. That said, often data is sent to both. For instance, when registering a super property marking a user as paid=true, it makes sense to send both people data and event data. The libraries for sending event data can be found here, whereas those for sending people data can be found here.

We recommend Javascript for web integrations

Javascript is the most robust library we have for integrating Mixpanel into your website. You are of course welcome to host the JS library locally, or to modify it if you desire, but unless you have a good reason, we recommend using our snippit that pulls the full library asynchronously from our CDN. Our Javascript has many features to make instrumentation as easy as possible, and if you use our snippit, you will be able to tap into updates that we make to the library without changing your code at all (in most cases).

In some cases, sending events server side makes more sense. For these instances, we offer more functionally limited libraries in many server side languages (python, php, ruby, etc.).

The javascript library works well for mobile applications that consit of html5 views, but for native apps we advise using our native Android and iOS SDKs. Our mobile SDKs are mature, offer the same functional richness as the javascript library, and the strategy for implementation is similar.

Paid customers should be careful who the project owner is

If you're a paid customer, the user who "owns" (is the admin of) the project must also hold the billing information for the project. You can email if you wish to transfer your project or billing info to a different mixpanel account.

Sending data to one project

If you have similar user behavior coming from multiple platforms (perhaps a Facebook game which also has a mobile version), we recommend you send all the data to one project and track the platform the data came from as a super property. That way you can look at one user's behavior across platforms, and choose whether or not to view all user activity on the same set of axes, or filter down to a particular platform. This is of course only recommended when the basic actions taken by users are similar enough to be described with the same set of event names (properties can be different).

Data flexibility

Mixpanel is very flexible and open ended tool. You can use it for anything from measuring how your users fair slaying digital monsters, to QAing a back- end fix, or monitoring and tweaking performance metrics such as how long it takes a UI to render. Anything that can be thought of as an "event" with "properties" can be tracked with mixpanel. Furthermore you can send us data from literally anything that can send an http request. Hacking our data model is not just expected but heartily encouraged. So use your imagination when you send events and properties. Don't let traditional ideas about web analytics limit the questions you can answer in a data driven way. And if you come up with a new or cool use for the tool drop us a line at so we can brag about you!

Introducing Predict - see who will convert, before they do.

Predict lets you know which of your users are going to convert, or not, before they do. Just select an action and, based on users' previous behavior, you'll get a grade on how likely each user is to complete it. Then target users by their grade. Like reaching out to those less likely to convert and giving them a nudge in the right direction. And starting today, Mixpanel Predict is live for all customers using People Analytics . Use Predict to impact leading metrics Use Mixpanel's predictive analytics to learn whether your app’s users will convert. You can define what converting means for your company as any action or event in Mixpanel – even the number of times it was done. Pick an important action that leads to success for your app (commonly called a leading metric ). So if you have a photo sharing app, you probably want to know who is going to share a picture. Or who wo...

Apple Music and Spotify: Parallel Product Teardown

This past June, Jimmy Iovine took to the stage of Moscone West in downtown San Francisco to introduce the always anticipated “one more thing” at Apple’s WWDC. Four years after Spotify brought the first mainstream streaming music service to America, Apple, the company that first turned music into a digital product, is unveiling its own service, Apple Music. A video plays on the large screen and now Trent Reznor is making lofty statements over a beautiful montage of people performing and consuming music. “Music has such power in our lives. The way we listen to and experience music is undergoing a profound change these days. To have access to nearly all the music in the world at our fingertips and in our pockets is remarkable,” Reznor narrates. “And yet there needs to be a place where music can be treated less like digital bits and more like the art it is, with a sense of respect a...

Community Tip: Downstream Effects of Notifications

Mixpanel Notifications are a powerful way to boost re-engagement with your site or app. In this Community Tip, we’ll discuss how to gauge the downstream effectiveness of your campaigns by analyzing how and to what degree they promote key user actions. Creating Notification Campaigns Before getting started with Mixpanel Notifications, you’ll need to create user profiles and set specific people properties to target your users. Push notifications also require that your app is correctly configured to receive pushes, and that you have the Apple Push Certificate and/or Android GCM API Key uploaded to your project. For reference, here are the guides for the creation of each type of notification: Email SMS In-app messages (Android) In-app messages (iOS) Push (Android) Push (iOS) Notification Analytics The Analytics tab next to your specific campaigns pro...

Community Tip: Server-side Identity Management

This Community Tip details how to maintain a user’s identity both in purely server-side as well as hybrid server-side and client-side implementations. Using these instructions, you can ensure user identity remains consistent across all server-side updates. Recently we published a Community Tip on maintaining user identity which highlights the nuances of identity management when users log in from multiple client-side devices. This post provides great insight and strategies to ensure the identity of a user remains consistent through the interactions made with your site or app. While implementations involving server-side updates follow the same basic principles, in this post we dive deeper into how identity can be maintained from the server-side perspective. Below we outline the two possible scenarios for your implementation: sending data only from the server, or from both the serve...

Scaling without losing focus on meaningful metrics - how Twitch gets it right

We're in the cafeteria of Twitch’s San Francisco office. Screens are on every wall, streaming games of League of Legends, Counter-Strike, and DotA 2. Dance music emanates from unseen speakers. A friendly golden retriever is wandering our way, looking for some attention. None of this fazes Drew Harry. He's focused - excited even - about documentation. "I know it's not everyone's favorite thing," he says. "But it's important." It is. Particularly at a company growing at the rate that Twitch is . Last year they more than doubled their monthly viewers – from 45 million to 100 million - and added a handful of new ways to watch, including PS4, Xbox One, and Chromecast apps. Educating everyone internally about how to find meaning in the midst of massive data and user growth has been a major challenge. "We've brought on a dozen new product managers. If they show up and just see 150 even...

Community Tip: Revisiting AARRR!

This Community Tip will revisit analyzing user behavior according to the AARRR analytics framework . By using Mixpanel to measure and iterate on the customer lifecycle, you can measure how business and product decisions independently affect acquisitions, activations, retention, revenue, and referrals. Please note this this Community Tip will focus solely on our Engagement reports; if you’re interested in learning how to apply the same AARRR framework for People notifications, check out our AARRR! for People Community Tip ! Making decisions without data leaves us in the dark, guessing as to whether or not we’ve optimized our site or app. When one is faced with data overload, it can be difficult to get through the noise and find the most impactful insights, which means lost time, lost efficiency, and potentially frustration. Dave McClure advocates for lean metrics with his Sta...

Community Tip: Maintaining User Identity

This Community Tip focuses on the nuances of identity management to ensure users are tracked within your Mixpanel implementation. This post describes best practices for single users on multiple devices, multiple users on single devices, and tips for handling user logouts. After you get started with Mixpanel , you will realize that identity management is one of the most important aspects of a Mixpanel integration. To attribute a user’s activity correctly, you must maintain the same unique identifier for a user throughout the course of their interactions with your app or site. Luckily, our SDK contains methods to manage this for both anonymous and authenticated users. Single Users on Multiple Devices: Alias on Signup, Identify on Login Nowadays, many users have multiple devices they can use to access their accounts — phones, laptops, and perhaps a tablet. How do you ensure that a ...

iOS 9 adoption hits 12% after 24 hours

After only 24 hours, and despite the usual delays caused by early adopters rushing to download the latest release from Apple, over 12% of users have upgraded to iOS9 . What's new The updated operating system comes with Apple News, a long overdue reworking of Newstand, and iCloud Drive, giving you access to any file in iCloud from your mobile device. Both Siri and the Notes app saw the addition of new features, and Apple Maps finally added a public transportation option for directions. Meanwhile, multitasking iPad users get new split-screen and picture-in-picture functionality. And users had to delete fewer selfies to clear up hard drive space for the download. While last years iOS8 tipped the scales at 4.58gb, this year's update was a noticeably slimmer 1.3gb. Head over to Mixpanel Trends to see the real-time adoption numbers as they come in. ...

How OpenTable improves UX by getting you in, out, and on your way

Creating the shortest path between you and a delightful meal "It’s not about how much time you spend in our app," says Alexa Andrzejewski, eschewing any notion that simply more user engagement is better. Alexa wants the right engagement. "We want to create the shortest path between you and a delightful meal." Exactly what that path is to your meal could be different for a hundred different reasons. At OpenTable, where Alexa is Mobile Experience Director, their top concern is that your trip is short and the meal is perfect for the occasion. Sometimes that path means looking at a single restaurant profile page, sometimes it means looking at seven. "In a high stakes situation - like if you're going on a date or taking someone out for a business meal - you're more likely to book a familiar restaurant." So finding and booking one specific restaurant for next Friday has to be easy....