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 support@mixpanel.com 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 support@mixpanel.com so we can brag about you!

Date property filters: Custom cohortize your events

Recent updates to date property filters allow enhanced segmentation and cohortization across all of Mixpanel's Engagement reports. Using date properties you can now create and analyze custom cohorts based entirely on important dates in your user lifecycle. New filters "on" and "between" When segmenting by a date property in Mixpanel reports, you will see two new filters, "on" and "between". These filters allow you to segment and cohortize your users into groups by date properties such as the date they signed up or a range of dates where users converted from free to paid. Using date filters in Mixpanel reports With these added abilities to cohortize users by their date properties, you can now more easily create cohorts of users and track their activity over time. For example, for an ecommerce site, you might wish to see how often users who were created 3 months ago return to ...

How Greenvelope Uses Mixpanel to Increase Sign-Up Conversion

Greenvelope strives to deliver the most elegant electronic invitation service by emulating the experience of opening a “traditional” printed invitation. Greenvelope uses Mixpanel's event based Engagement Analytics and People Analytics to gain actionable insights from how users' interact with their website. By creating a positive online experience, Greenvelope hopes more hosts will consider sending invitations electronically for formal events - to help save trees, time, and money. In 2014 Greenvelope received the coveted "Wedding Wire’s Couple Choice Award for Excellence.” Knowing this had the potential to elevate the brand, they wanted to share their success with potential customers. However, they were hesitant about how best to use this award to advertise their success. By measuring the conversion rates of various options with Mixpanel’s funnel report they were able to take all th...

Gett uses Mixpanel to optimize experiences, focus outreach, and encourage action

Gett is revolutionizing the taxi experience for both consumers and drivers by reducing the time to value of getting a taxi or black car. Gett uses Mixpanel’s event based Engagement Analytics and actionable People Analytics to help make product decisions and reach their customers on both their iOS and Android apps. The app is already up and running in 32 cities globally including New York, London, Edinburgh, Manchester, Birmingham, Glasgow, Moscow, St. Petersburg, Jerusalem, and Tel Aviv. In peeling back multiple layers of this Mixpanel Customer Story, we spoke with Gett's Anatoly Volovik, Product Manager, and Libby Alpert, Global Marketing Operations, about their experiences using Mixpanel. Areas of focus include features such as 1) Funnels 2) Retention 3) A/B Testing and 4) Notifications. What we quickly realized was that not only are they using these Mixpanel features, but they ...

Community Tip: Optimizing for goals with A/B tests

Mixpanel can help you take advantage of A/B testing for your app, website, or notification content to drive user action and engagement. This Community Tip will walk you through three awesome, real life A/B testing examples. How can Mixpanel help you A/B test? For your iOS app, A/B testing will allow you to experiment and tweak your app without app store resubmission. You can also track A/B tests for web by utilizing super properties (note that the “mpmetrics” call in this post has changed to “mixpanel”). Finally, you can run A/B tests with Mixpanel notifications from the Mixpanel web interface. When doing any A/B testing, remember to tweak only one variable per variant, so as to keep "all else equal" and make it easier for you to pinpoint exactly which change made an impact on your users’ behavior. A/B testing for mobile apps There are two ways you can A/B test on mob...

Community Tip: Use Property Types to Turbocharge Reports

This Community Tip includes three ways to leverage property data types to turbocharge your filtering, segmentation, and cohortizing power across Mixpanel reports. Events are the atomic units of Mixpanel analytics. The true power of Mixpanel’s reporting, however, comes from properties. Any detail of an user’s action (like an adverb) or a fact of about a user (like an adjective) can be provided as a property. There are three high level kinds of properties: event properties, event super properties , and People properties . You can understand the differences between these three by reading the Community Tips dedicated to each. This Community Tip will focus on the best ways of using the different property data types. Properties are incredibly powerful because they enable you to slice and dice, filter and segment, or roll-up and divide your data to get actionable insights. People prope...

How Outplay Uses Mixpanel to Build Successful Games

Outplay is an innovative, mobile and social game developer with a mission to create fun games of the highest quality across a wide range of platforms. Outplay decided to use Mixpanel instead of building their own analytics stack because Mixpanel empowers teams to leverage data to understand users and make decisions. As a result, Outplay overcomes competition with successful games that people love. Build or buy Outplay has always known the importance data has in creating awesome games. Though it has always been a high priority, Outplay did not rush into just any analytics solution, but decided to begin the search for a long term, strategic analytics partner. Outplay tried other analytics solutions, but was frustrated at how overly prescriptive these products were: telling them what to track instead of empowering Outplay's teams to track what mattered. When Outplay found Mixp...

Community Tip: Last Touch UTM Tags

This Community Tip describes how to tie users' most recent UTM tags (aka last touch attribution) to their actions. We will detail why it's useful, provide code for developers in JavaScript, and show the power in Mixpanel's reporting. Why track last touch UTM tags? Last touch attribution allows you to see how a user found your site most recently. You can utilize last touch UTM properties to measure the effectiveness of various marketing campaigns through Mixpanel's Segmentation report. You could also leverage Mixpanel's a Funnel report to determine if specific campaigns impacted conversions. If a user eventually ends up making a purchase or completing some other event of consequence you can use last touch UTM tags to determine what acquisition channel brought them to the site most recently. First touch UTM tags are automatically tracked by Mixpanel's JavaScript Library and sto...

Community Tip: JavaScript Implementation Roundup

This Community Tip will walk you through implementing Mixpanel using the JavaScript library. This walkthrough will cover not just how to insert Mixpanel code into your website, but also how to decide what events and properties to track. Get acquainted with Mixpanel You heard from your developer friends that Mixpanel is awesome, and you want to see it for yourself. But where to begin? A great place is our Live Introductory Webinar . The Webinar is specially aimed toward new Mixpanel users and it broadly covers Mixpanel’s capabilities, how to think about your analytics, and how to get started with your own data tracking. Plan your implementation: It starts and ends with your business goals Mixpanel is a highly customizable data-tracking solution that gives you the power to decide what actions to track and how to track them. With flexibility and power comes great responsibility, ...

Community Tip: Setting up Deep Linking in iOS and Android

This Community Tip will walk developers through mobile deep linking via Mixpanel’s In App Notifications. For both iOS and Android mobile, we will describe the code changes and describe how to include deep links with Mixpanel notifications. Why are deep links useful? Deep links create an experience that links users directly to the content they desire. In today's mobile ecosystem, moving between applications or within applications can be friction-filled and lead to low conversions. For example, when sending a notification to have your users try a new feature, a deep link can point users precisely to the relevant view. Creating a flexible deep link architecture in your application and using tools like Mixpanel’s People Notifications allows your mobile team to drive user engagement to precise locations quickly and effectively. In the next sections, we'll take you through the steps to...