Mixpanel is an advanced analytics tool that requires the proper setup, otherwise, you will not be able to get the critical insights that you’re looking for. This guide will show you how to properly plan your Mixpanel implementation and how to use the different reports to analyze your data.
This tool will help you understand how your marketing campaigns are doing, how your users are using your product and much more. However, you first need to understand how to properly set up Mixpanel and how this setup is fundamentally different from other tools like Google Analytics.
There is a lot of material in this guide so you can use the links below to jump around to the most relevant sections.
I’m also excited to be updating this post for 2020. Mixpanel has changed quite a bit of the last year (for the better) after being stagnant for a few years. Jump into my “Mixpanel in 2020” update below to learn more.
Annual Updates
Mixpanel Basics
- Why Should You Use Mixpanel? Common Use Cases for Different Industries and Products.
- A Crash Course on Key Terminology: Events, Properties, and Profiles
- Pricing
Deep Dive Into Key Mixpanel Reports
- Insights: Slice and Segment Your Data to Find Trends and Answers
- Funnels: Visually See Conversion Dropoffs in Your Product or Website
- Formulas: Track Complex Calculations Without Excel
- Signal: Find Insights Such As Facebook’s “7 Friends in 10 Days”
- Retention: Find and Understand Your Best Users
- Live View: See Your Data Come in Real Time
- Flows: Explore the Different Paths Users Take Throughout Your Product
- Dashboards
- Lexicon: Tools for Managing Your Data Governance
- Integrations: Take Data In and Out of Mixpanel and to Other Tools
Understand Your Users
- Explore: Viewing the Timeline of a User
- Cohorts: Organize User Into Actionable Buckets
- Predict: Use Machine Learning to Rate How Likely Users Are to Convert
Take Action Based On Your Data
- Campaigns: Send Multiple Messages to Users and Tell a Specific Story
- Messages: Send Actionable Messages Based on User Behavior
- A/B Testing: Easily Run A/B Tests for Your Mobile Apps
Advanced Functionality
- JQL: Run Custom Queries Against Your Raw Data
- Revenue: Run Reports Against Metrics like LTV and ARPU
- Build An App: Build Simple HTML Apps to Visualize Your Data
Technical Implementation Notes & Best Practices
- Properly Implementing Mixpanel
- Choosing the Best SDK for Your Application and Other General Notes.
- Planning Your Implementation Using Tracking Plans
- Walkthrough a Javascript implementation:
- Getting Started with the Javascript Library Plus Should You Use Segment.com?
- How to Send Your First Event Plus How to Use the “Live View” report
- How to Track Clicks and Form Submissions
- What Are Super Properties and Why You Should Use Them
- How to Properly Identify Users Using Identify and Alias
- How to Set People Properties
- How to Increment Properties
- How to Track Revenue
Competitor Analysis
Related: If you’re in charge of marketing or product at your company, be sure to check out the 6 Reports That You Should Be Running to increase the growth of your product and company.
Annual Updates
Mixpanel in 2020
Mixpanel has been really killing it over the last year. They refreshed the interface of their product, released several new reports like Impact, Lexicon, and Cohorts (plus more) and added more integrations to other tools.
All of these changes were long overdue and puts Mixpanel back into the top of the analytics space. I recorded a 12-minute video going over some of these changes, where I think Mixpanel is going in 2020 and how it fits into your overall strategy.
Mixpanel Basics
Why Should You Use Mixpanel? Common Use Cases for Different Industries and Products.
Let’s start at the end. Before we go to deep into Mixpanel, I’ll talk about the different uses cases that this tool can help you with. This will give you an overview of how your company can get value out of this tool and why you should even bother implementing it.
A Crash Course on Key Terminology: Events, Properties and Profiles
In this lecture, we are going to take a crash course in the most common terms you should know. You have three major terms:
- Events: these are the actions that users take in your product or website. Common actions that could be translated into events are: signing up for your product, downloading a PDF and becoming a paid customer.
- Properties: these go along with your events (or actions) to provide more information about any event. For example, our sign up event could include the following properties: first name, last name, email, and location like country, city, and region. You can create your own properties plus Mixpanel also tracks several properties by default.
- Profiles: these are also called “users”. Profiles are how you can attach events to a specific user and then view their activity instead of looking at only the anonymous activity (such as Google Analytics).
Pricing
Our final video will look at the current pricing that is being offered and how to plan your implementation based on whatever plan you end up choosing.
Diving Deep into Specific Reports & Functionality
Analysis
Insights: Slice and Segment Data to Find Trends and Answers
Insights is the first fundamental report that you need to understand master. It’s one of the most versatile reports which lets you answer a broad array of questions. It’s the perfect report to start understanding how Mixpanel stores and analyzes data.
Funnels: Visually See Conversion Dropoffs in Your Product or Website
Mixpanel is known for having a great funnel analysis report and in this video, we’ll go over this report. We’ll learn how to set up funnels and how to segment your funnels by event and people properties. We’ll also cover some handy tricks for making your funnels more useful.
Formulas: Track Complex Calculations Without Excel
Formulas will allow you to run complex calculations on your data without turning to Excel. If you ever wanted to answer questions like “On average, how many actions do our users take?” or “How many users are doing X on a daily basis?” then this is the report for you.
Signal: Find Insights Such As Facebook’s “7 Friends in 10 Days”
Signal is our first report that is enhanced by machine learning. It is meant to help you find correlations between your events to better understand what drives key product outcomes like retention or other conversion events.
Retention: Find and Understand Your Best Users
Retention will let you organize your users into groups (or cohorts) and understand how they are using your product. This can become one of your most useful reports as it will help unlock insights around why your best users love your product.
Live View: See Your Data Come in Real Time
Live View is a simple report but I’ll show you how to use it to debug your implementation and a few ideas that can help you better understand how data is captured and processed.
Flows: Explore the Different Paths Users Take Throughout Your Product
Flows will help you better understand what paths your users are taking towards a specific conversion. This can be very helpful especially if you find yourself trying to improve an onboarding flow or other product flows.
Dashboards
Once you create a handful of reports, Dashboards will let you organize them in a single location. This functionality has been evolving quite quickly but you can easily build dashboards for your entire team or company.
Lexicon: Tools for Managing Your Data Governance
Lexicon will solve one of the most underrated issues in analytics: data governance. You’ll be able to transform (rename, hide, etc) your data and better explain your data by adding descriptions and other useful tips.
Integrations: Take Data In and Out of Mixpanel and to Other Tools
Mixpanel will likely be one of the many tools in your stack and you need it to play nicely with other tools. Thankfully, Mixpanel has been investing heavily in technology integrations to get data in and data out.
Users
Explore: Viewing the Timeline of a User
The Explore report will let you learn more about your individual users and the specific actions they are taking within your product. The functionality is relatively straightforward but it can be powerful to look up a specific user and be able to dig through their product usage.
Cohorts: Organize Users Into Actionable Buckets
Cohorts will let you organize your users into groups based on their behavior or attributes. You can then take these groups and use them throughout most of the other reports. Common cohorts you might be familiar include New Users, Active Users, and Power Users.
Predict: Use Machine Learning to Rate How Likely Users Are to Convert
Predict is our second report that utilizes machine learning to help you better analyze your data. The Predict report will go through your users and give it a rating (A to D) in terms of how likely they are to convert to a specific action.
Take Action
Campaigns: Send Multiple Messages to Users and Tell a Specific Story
Campaigns is a more advanced way of sending messages. You can organize your messages into a coherent strategy and track the impact of the overall campaign and not just individual messages.
Messages: Send Actionable Messages Based on User Behavior
Once you know how well (or bad) your users are doing, then it is time to take some kind of action. Sending messages (email, SMS, etc) is one of the best ways to bring users back into the product and Mixpanel makes this is a breeze. We’ll even be able to track the impact of our messages across funnels and other reports.
A/B Testing: Easily Run A/B Tests for Your Mobile Apps
You can also run A/B tests and track these experiments alongside your data. This functionality is limited to mobile apps so you would need another solution to run A/B tests across websites or web apps.
Applications
JQL: Run Custom Queries Against Your Raw Data
JQL was created so you are able to easily work with your raw data and run more complex calculations. This is an equivalent to SQL and gives you quite a bit of flexibility beyond the existing reports.
Related: If you’re in charge of marketing or product at your company, be sure to check out the 6 Reports That You Should Be Running to increase the growth of your product and company.
Revenue: Run Reports Against Metrics like LTV and ARPU
Revenue will let you run custom calculations on your revenue data to come up with metrics like LTV and ARPU. This report requires that you track your revenue data in a specific format.
Build An App: Build Simple HTML Apps to Visualize Your Data
Apps is another way of working with your data to create custom visualizations. You’ll be able to query your data using the public APIs and build simple HTML apps to display this data.
Properly Implementing Mixpanel
Choosing the Best SDK for Your Application and Other Notes.
In this video, I’ll talk about the key things you should keep in mind when implementing Mixpanel. I’ll talk about the different SDKs and how to choose the best one for your app.
The three client-side libraries that Mixpanel offers are Javascript for the web, and iOS/Android for mobile. Mixpanel also offers server-side libraries for Ruby, Python and a few other languages.
All libraries can capture the same data but client-side libraries will capture quite a bit of information out of the box. For example, the Javascript library captures all these properties by default:
Event Properties
- City ($city) – The city of the event sender, parsed from IP.
- Region ($region) – The region (state or province) of the event sender, parsed from IP.
- Country (mp_country_code) – The country of the event sender, parsed from IP.
- Browser ($browser) – Browser name (not versioned).
- Browser Version ($browser_version) – Browser version number.
- Device ($device) – The name of the event sender’s device, if they’re on the mobile web.
- Current URL ($current_url) – The full URL of the webpage on which the event is triggered.
- Initial Referrer ($initial_referrer) – Referring URL at first arrival.
- Initial Referring Domain ($initial_referring_domain) – Referring domain at first arrival.
- Operating System ($os) – OS of the event sender.
- Referrer ($referrer) – Referring URL, including your own domain.
- Referring Domain ($referring_domain) – Referring domain, including your own domain.
- Screen Height ($screen_height) – The height of the screen of the device.
- Screen Width ($screen_width) – The width of the screen of the device.
- Search Engine ($search_engine) – Search engine a customer used when they arrived at your domain.
- UTM Parameters (utm_source, utm_medium, etc.) – Any utm tags associated with the link a customer clicked to arrive at your domain. Each utm will be collected under its own property.
People Properties
Default properties update within a profile whenever a property is set or updated with a mixpanel.people.set() call.
- City ($city) – The city of the event sender, parsed from IP.
- Region ($region) – The region (state or province) of the event sender, parsed from IP.
- Country ($mp_country_code) – The country of the event sender, parsed from IP.
- Timezone ($timezone) – Timezone of the event sender, parsed from IP.
- Browser Version ($browser_version) – Browser version number.
- Browser ($browser) – Browser name (not versioned).
- Initial Referrer ($initial_referrer) – Referring URL at first arrival.
- Initial Referring Domain ($initial_referring_domain) – Referring domain at first arrival.
- Operating System ($os) – OS of the event sender.
- Last Seen ($last_seen) – The last time a People property was set or updated (should not be set manually).
You will run into some issues when you try to capture an event through the Ruby library and then you realize that the Ruby library doesn’t automatically collect location properties such as country, city, and region. In that case, you’ll need to pass an IP address and this can be parsed this into the relevant properties.
Planning Your Implementation Using Tracking Plans
Properly planning your implementation is a critical step to getting the data you want and getting accurate data. In the video above, I’ll walk you through how to do this using a document called tracking plans.
Walkthrough a Javascript implementation
Getting Started with the Javascript Library Plus Should You Use Segment.com?
In this video, we dig deeper into the Javascript library or SDK. As mentioned in the previous video, there are different client side libraries you can use to send events.
For the purpose of this guide, we will use Javascript to understand the different kinds of functions and features available to us. At the end of this video, I briefly go over Segment.com and why you would want to use it.
How to Send Your First Event to Mixpanel Plus How to Use the “Live View” report
In this video, we will send our first event to Mixpanel! We will explore the core function called “mixpanel.track”. This is the most basic function and the one that you will use the most throughout your implementation.
We will also look at how event names and event properties are handled throughout the different functions. Finally, we get to take a look at the “Live View” report which shows all of our data as it comes in real time.
How to Track Clicks and Form Submissions
In this video, we will look at how to track clicks on links and form submissions. These two actions tend to cover nearly everything that we would want to track in a web app or website.
The function to track links looks like this:
mixpanel.track_links(‘#idolink’, ‘Clicked CTA Link’);
We entered the ID of the link (CSS ID) and then Mixpanel will attach itself to that link. When a user clicks it, this will fire an event which we called “Clicked CTA Link”. You can also add properties just like through our mixpanel.track function.
The function to track form submissions looks like this:
mixpanel.track_forms(‘#signupForm’, ‘Sign Up Completed’);
Just like with links, all we need is the unique ID of the form that we would like to track. The handy part of this function is that we can ensure that we are only firing events when forms actually get submitted. This makes our data more accurate and useful.
What Are Super Properties and Why You Should Use Them
In this video, we will look at “Super Properties” and how to use them. Mixpanel describes Super Properties like this:
“Super Properties are a type of Event Property that you can set once to automatically attach to every Event you’re tracking. They are Event Properties that apply to all Events without having to manually include them in each mixpanel.track() call.
Because Super Properties send values associated with Events, they are useful for seeing Properties over time. For example, you could set a Super Property to indicate with all of your Events whether they were done by a free or a paid user. Then, if a user changes from free to paid, you can see over time which Events led up to that conversion and which specific Events they did as each type of user.” – Source
There are 3 functions that can help you set and remove super properties:
mixpanel.register({‘User Type’: ‘Free’}); //Add a super property called User Type
mixpanel.register_once({
‘First Login Date’: new Date().toISOString()
});//This function won’t overwrite existing values like register
mixpanel.unregister({‘User Type’}); //Remove a super property
How to Properly Identify Users Using Identify and Alias
When it comes to identifying users, we will use two functions: mixpanel.identify and mixpanel.alias. Before we go into each one, let’s look at how Mixpanel handles users.
How Mixpanel Handles Anonymous Users
When a user first visits your website or app, Mixpanel gives them a unique identifier. This is how they are able to keep track of all the actions that a user might take. In the Javascript library, the identifier looks like this:
13bbf7243e584-0884c2531-5c793977-3e8100-13bbf7923e64cf
This is stored in the cookie of the user which leads to a few issues:
-
- Different Device: If the user visits your website or app through a different device, they will get a new ID. This is considered a whole new user even though they aren’t.
- Different Browser: If the user uses a different browser or simply clears their cookies, they will get a new ID.
This identifier is called “Distinct ID” and you can see it by going to the “Live View” report:
![Using Mixpanel Identify and Mixpanel Alias [Code Examples]](https://rubenugarte.com/wp-content/uploads/2016/04/mixpanel-identify-distinct-id-1024x401.png)
Learning to Manage Our Own User IDs
The two functions listed above (mixpanel.identify and mixpanel.alias) will then allow us to give our users a new ID. Ideally, we are giving them a permanent ID that will never change. Some good options are:
-
- Database ID (best option)
- Email (second best option
- Other IDs
Once we can manage our own IDs, we can then solve the common problems listed above. Let’s see how we can convert the anonymous ID into something that we control.
Starting with Mixpanel Alias
Let me start by saying that identifying users in Mixpanel is a two-step process. We first need to alias their default anonymous ID with something we control and then we need to identify them with our new ID.
This means that the first function we would fire is mixpanel.alias which looks like this:
mixpanel.alias(“hello@rubenugarte.com”);
We are simply giving it our new ID, in this case, an email. We don’t have to specify the existing anonymous ID since Mixpanel assumes that’s what we mean.
If we ever need to change IDs again, we can fire alias again with the old and new ID like this:
mixpanel.alias(“new@rubenugarte.com”, “old@rubenugarte.com”);
Firing alias is step 1 in our process. We still have one more step: mixpanel.identify.
Using Mixpanel Identify
After we fire alias, we now need to fire mixpanel.identify to tell Mixpanel some crucial information. The basic function looks like this:
mixpanel.identify(“hello@rubenugarte.com”);
This finalizes the identification process though you probably still won’t see users under the “Explore” report. That will happen once you set people properties.
Automating Mixpanel Alias and Mixpanel Identify
Now that you need the basics behind identifying users, you need to automate this process. These functions need to be fire at the right times and lucky for us, there are two instances that align perfectly with what we need.
We can fire mixpanel.alias and mixpanel.identify when a user first signups. The signup is usually something that only ever happens once which is perfect for this two-step process.
We can then fire mixpanel.identify every time the user logs in. This will help us catch different devices and different browsers if they ever come up.
How to Set People Properties
People Properties are super properties that are attached to specific user profiles. Before you set them though, you need to fire mixpanel.identify(), otherwise, your call will fail.
Just like event properties, there are a few default properties that you want to avoid using. Finally, you can use any People Property to segment your data through reports such as Segmentation and Retention.
How to Increment Properties
In this video, we will look at a minor but useful function: mixpanel.increment. This function makes it easier to track counts such as credits, page views or anything that should be counted.
The function increments or decrements people properties. To decrement, simply pass a negative integer into the function.
mixpanel.people.increment(‘credits’, 1);
How to Track Revenue
Our final note in this section will look at the revenue functions of Mixpanel. This is one of my favorite reports because it connects user actions with actual dollars.
The revenue functions are one of those few events that benefit from being fired in the backend of a product. This makes them more reliable and easier to connect to your payment processor.
You have two functions here:
mixpanel.people.track_charge(50); //Track revenue on a user
mixpanel.people.clear_charges(); //Remove revenue events from a user
A special note is that Mixpanel will do a bunch of logic from the track_charge function. It will create a couple of people properties plus populate the “Revenue” report which we will look at in another video.
Related: If you’re in charge of marketing or product at your company, be sure to check out the 6 Reports That You Should Be Running to increase the growth of your product and company.
Competitor Analysis
Mixpanel vs Amplitude
Amplitude offers very similar functionality to Mixpanel and is one of the most popular competitors that clients ask us about. I’ll compare both tools across functionality, philosophy, pricing and much more.
Mixpanel vs Google Analytics
Google Analytics isn’t a direct competitor to Mixpanel and instead offer complimentary tracking. I’ll talk about how these tools compare and how to use both of them within your own stack.
Mixpanel vs Segment.com
Segment.com is also complementary to Mixpanel and quite useful to add to your stack. I wrote an entire article as to how Segment.com works and how it plays with tools like Mixpanel. Highly recommend that you understand why you would use Segment.com and consider it implementing it.
Mixpanel vs Woopra
Woopra is another popular competitor and this video, I’ll compare both of them. While they have similar functionality, they each shine in their respective categories.
Conclusion
Next steps
At Practico Analytics, we specialize in helping companies properly set up tools like Mixpanel. Improper implementations can be quite costly in terms of resources and time wasted. Learn more about typical client results, past case studies or get in touch with us.