16 lessons I learned after a year of Mixpanel

16 lessons I learned after a year of Mixpanel

Mixpanel is an incredible analytics platform.

Thanks to Mixpanel, you are able to answer complex questions about your product without the intervention of your developer after the implementation of the platform.

Who are my users? Where do they stop in my funnel of sign up? Are they loyal? Which feature is most used by my users acquired by Twitter who are not premium?

These are some of the questions Mixpanel will answer in a moment.

After using Mixpanel for a whole year, I give you all the mistakes I made and lessons learned not to reproduce at home.

In this article I am going to use 4 terms Mixpanel:

  • Event: Data sent to Mixpanel during an action executed in your app
  • Property: Parameter attached to an event that specifies it
  • Super Property: Property to define once that will be applied to all your future events
  • People property: Data about your logged in user registered in Mixpanel

Know your business goals before you start

The tool is not magic. It will not give you answers without doing anything before. The first step before using Mixpanel is to clearly know why you are using it. Set goals you want to achieve with Mixpanel. Increase your turnover, improve your retention, improve your conversion tunnel ...
A clear goal will help you know what to measure and where.

Make a thoughtful and accurate tracking plan

The tracking plan is the base of Mixpanel. It contains all the events to code and allows the developer to have the list to guide it. I use Google Sheets to create this plan.

I designed it specifically for developers. It is accurate and suitable for them to make their job easier.

Download here the tracking plan

I mixed several examples of Mixpanel events in this table below:

  • Column A: (Date added) To know when you added the event. It keeps track and tracks when you add events in the future.
  • Column B: (Trigger) Very important. It must describe very precisely when exactly the event should occur. At the click, when viewing a view, when moving the mouse over an element ... Take the time to describe your event. Platform developers do not have the same trigger in mind for an action.
  • Column C: This is the name of the event.
  • Column D: It contains all the names of the properties of the event.
  • Column E: These are the values ​​of the properties. Most often they are variables.
  • Column F: Name of the people properties
  • Column G: The value of the people properties
  • Column H: Name of the super properties
  • Column I: Value of the super properties

The last three columns allow to check if the event is to implement or not.

A column that you can add is the "WHY". I do not use it, but allow to be clear in its reasoning and explain to your developers the utility of this line.

As formatting, I chose to separate each event by a gray bar. So if you have to add an event in the middle later, that's fine.

Integrate the standard peoples properties of Mixpanel

When creating an account, if you use Mixpanel, you will have to create your profile automatically in Mixpanel. It is important to use the standard properties of Mixpanel to have a normal display in the Mixpanel UI. Here is the list:

  • $first_name
  • $last_name
  • $name
  • $email
  • $phone: Optional
  • $created: [date]

Do not forget them, because it makes the use of "Explore" almost unusable.

Think of not so obvious events properties and people properties at the beginning

When thinking about your tracking plan, you do not always think about everything that can be tracked. Catch as many properties as possible in event and people!
Example of event properties:

  • userId: id of your user in relation to your database
  • Premium: true / false
  • Option A: true / false
  • Ad Campaign: "FB-01"
  • Source signup: string
  • Logged: true / false
  • Device: iOS / Android / Web (super property)
  • Mixpanel does not include easily exploitable device segmentation. Add the property if necessary.

Example of people properties:

  • Swipe left: increment
    Swipe right: increment
  • Swipe total: number
  • Job: string
  • Last purchase: date
  • average price of purchase: number
  • Points earned: number
  • Games played: increment

I voluntarily put a long list without much sense to give you a maximum of data. I repeat, think of everything.

Also note that Mixpanel natively integrates properties such as OS, app version, country, etc ... available there.

Choose the right nomenclature for your events

My events and people properties all start with a capital letter and the words are separated by spaces: Event id; E-mail ; # of message sent ... I prefer to adopt a human nomenclature rather than code. The navigation in Mixpanel will be easier.

A good event is one that can be segmented.

Example: On my site I have several share buttons. One for Facebook, the other for Linkedin and the last for Twitter, and I want to track them..
Two choices are available to me:

  • I create a separate event by buttons: "Share by Facebook", "Share by Twitter" ...
  • I create a "Share" event and add the "Medium" property.

The good solution is 2. I reduce the number of events and I can know how much sharing there was in total and then segment deeper. It is also more scalable because I can add a medium without a problem.

Correctly organize your Mixpanel events

This is the most complicated party. Take the time to do it and think carefully before completing the chart. Think about the implementation of the event and its later use in Mixpanel.

There are many ways to organize your events, here's mine:

In my tracking plan, I have absolutely everything that is possible. From displaying a view, to pressing a logout button, to submitting a form ... It's a choice I made. So, I can anticipate complete reports on Mixpanel and long funnels to really know where my users are going. Be careful not to go into the abuse, tracking must keep a minimum of meaning.

A good event is one that will have an impact on your decisions.

The first reflex is to create a separate event per event performed in the app. I did not follow this idea. To avoid being swallowed up by hundreds of Mixpanel events I made the following decision:

I group the events by category of features: Scan, Chat, Sign up, Cart, Buy ... Then, I specify for each event the action executed in event properties.

  • Event: Chat; Action: View chat
  • Event: Chat; Action: Create conversation

Thus, I reduce the number of events visible in Mixpanel and access it through segmentation.

There is a disadvantage to using this method. Mixpanel and other tools like Amplitude rely on events to do their analysis and not event properties.

Let me explain: Signal, a feature I explain below, aims to tell you "here, when this event is executed by the user, he remains loyal". The problem is that if you group by category as I do, Mixpanel will be less precise and can not say "yes, this event is the right one".

Today, there is no solution if you use my method.

The other method that highlights Mixpanel in its examples of tracking plan is to stay on the surface. Do not measure absolutely everything, but only events really important to you. You limit the data, but it is more suited to data analysis by Mixpanel. To know what to measure in this case, use only events that can have an impact on your business such as "Buy", "Play video", "Watch video". To list them, create your funnel that answers your problem and attach the associated events.

Check all platforms for tracking before going into production

Once your developers have finished coding Mixpanel, it is very important to check the correct implementation of it. Here are some instructions to respect so you do not forget anything:

  • An event must be executed in the same way on all platforms (iOS, Android, Webapp) otherwise they do not have the same value and meaning
  • The reset () is executed at the log out and generates a new distinct_id.
  • Peoples properties are well created at registration

There are a lot of other things to check ... it's up to you to find them based on your case

Why is it important?

Putting into production is always a heavy process and prepared in advance. Once your users have downloaded your application, they will ship with them a certain version of Mixpanel. If you realize that there is a bug, one forgets about people properties etc ... you will have to make a new version of the app. Some of your users will not update. So you will always have users with the old version of the app and therefore Mixpanel. Even if you can segment by app version, it's better to have a clean code from the beginning.

Warning: on iOS and Android events take a minute to appear and it's normal.

The distinct_id should never change in the live-view of Mixpanel

The distinctid is an id (not without joke) that is assigned automatically to each of your users. It is added to all your Mixpanel events to see which user ran this event.
The distinct_id also aims to tell Mixpanel: "The user did X and X events before being registered". On the user card, we can see:

  1. Visit the A2 page
  2. Visit page B
  3. Registration
  4. Visit of the member area

The user was not logged in yet, but I know what event he did before being

On your side, you must make sure that your user always keeps the same distinct-id. Open the live-view page of Mixpanel and run multiple Mixpanel events with a register in the middle. If the distinct_id does not change between the events done and after the register, it's OK. If, on the other hand, you do not see the events done before the register, there is a problem.

In the code, the alias () function must be used before the identify (). Your dev will understand.

More information on this page.

The reset () function is not enough on iOS and not to forget

The Mixpanel.reset () function is to be implemented when your user disconnects from your application. This will have the effect of:

  • Regenerate a new distinct_id
  • Empty the people properties
  • Empty super event properties

On iOS, the task is a bit longer. The reset () of iOS does not create a new distinct_id, it must be done manually.

Here is the code to add after the reset (). I am not a swift developer but your dev will understand.

Mixpanel.mainInstance().reset()

let uuid = UUID().uuidString

Mixpanel.mainInstance().identify(distinctId: uuid)
  • I clean the super properties and people thanks to the reset
  • I generate a new uuid
  • I assign it to my user

You will find more information on this article.

If you have super events properties, do not forget to set them again after the reset ().

Mixpanel gives you the what, but not the why

This is one of the big problems of Mixpanel. When I say "what", I imply that the platform is perfect to show you what's happening right now in your app. The segmentation of the data is great and the display too.

What is unfortunate is that you will not know when your users become loyal for example. There is no analysis really pushed on your data. Compared to Amplitude (the competitor of Mixpanel), the tool is x10 better. I will probably do an article that compares the two.
However, Mixpanel is aware of being late. In their roadmap, they focus on data mining. One can note for example the feature "Survey" which has disappeared. It allowed to create polls displayable directly in the app.

I said earlier that there is no thorough analysis of your data. This is not entirely true. Two Mixpanel features exist but are very far from those offered by Amplitude: Signal & Predict.

Signal answers the question I mentioned before. "Why are my users staying?" and "What events are associated with retention?"

I have not been able to use this function yet.

Signal is explained in detail on this article

Predict is based on machine learning to give a rating to your users from A to D if they are more or less likely to perform a particular function that you have defined.

Unfortunately, I have not found any usefulness in this prediction.

More explanation here and on the video below.

The API is very developed and can be useful

Mixpanel integrates an API to interact with your data. This is useful for creating your own dashboard for example.

In the company that I work in, we use it for several functions:

  • I programmed a slack bot in node.js that sends me an MP every Monday morning to give me Marketing KPIs. An article to do the same will be published.
  • We also use the API to give our customers (event organizers) stats about using Swapcard during their events. Integration is very advanced and coupled with other data ...

In short, if Mixpanel does not do everything you want, create it.

Stay available with its devs during the coding

Even with a perfect tracking table, your developers will have questions. Make it clear that you are ready to answer any questions while coding Mixpanel in your app. Most often, they will ask you when the event should be sent.

If you have some idea of ​​code, I invite you to understand how the Mixpanel SDK works to help your developers if they have problems.

For my part, I have advanced bases (5 years of PHP dev, among others) in coding. With the iOS developer of Swapcard, we were stuck on the reset () function because I did not understand why the distinct_id did not change during the reset (). To save Serguy (dev iOS) time, I created an iOS project on my mac and tried to understand Mixpanel on iOS. In the end, I solved the problem alone and saved the team time.

Put yourself in the developer's shoes

It's not easy when you do not understand the code, but implementing certain events or properties is not always easy for the developer. A desired variable in properties is not always available in the code as you want. This forces the dev to encode an express function to create your event. I prefer to find an alternative if it's too much of a burden for him.

Also, understand that it is not an exciting thing for your developer to install Mixpanel. Explain clearly the purpose of this tool and how it will be useful to improve the product. Hence the importance of being available for your developer.

Document yourself to the fullest before launching into the void

Mixpanel is not easy to handle. There are several notions to assimilate. How to track my events, what are the super properties, people, distinct_id, etc ...
The platform offers a multitude of documentations to understand it. Here are some useful links to help you:

I recommend reading the book "The Lean Analytics" to have a global vision of analytics in a startup.
And do not forget that Google is your friend :)

Assign a person responsible for Mixpanel

Appoint a person in charge of Mixpanel who will have to create the tracking plan, be the interlocutor between your devs and the marketing department and will check the correct implementation of Mixpanel. I think it's important to have someone who has complete control of the project as a whole.

Create a PROD and DEV project on Mixpanel

Your developer will probably do it naturally. I advise to create two separate projects in Mixpanel not to "dirty" your real data. Create two projects in Mixpanel and tell your developer to change the token based on their code environment. When putting into production, make sure that the token is changed.

Mixpanel support is amazing

I could not write this article without mentioning the support that Mixpanel offers. It is magic. To communicate with them, I go by email and they usually answer within 24 hours.

It is a team that will make the effort to always give you a complete answer and to understand your problem as much as possible. If necessary the support will go on your project to show you an example. When you have a concern with Mixpanel, give them as much detail as possible to go faster.

Conclusion

Mixpanel is the perfect tool to better understand your product and your users if you use it with care. I hope to have passed on my knowledge acquired during this year and that you will not reproduce the same mistakes as me.

To summarize, track down everything and well. Think of all the possible properties. They are a gold mine when they are there. Be available for your developers and everything will be fine.

If you are about to adopt Mixpanel, do not hesitate to contact me for more information.

PS: If you know a friend who might be interested in my article, share it with him or her.