Separate Development Data
We recommend that you set up a separate project for your development environment. Keeping your development data separate is important to maintain the integrity of your Mixpanel data. It’s easy to prevent development data from cluttering your production project, but hard to detangle in later stages of a project. To set up separate environments:- Create two separate Mixpanel projects for development and production. Mixpanel doesn’t limit the number of projects you can use. If you are on an MTU plan, keep in mind that an organization is charged based on the total number of MTUs across all projects. This means that if a user performs a qualifying event in multiple projects, they are counted once per project. Once you have tested thoroughly in your development environment, stop sending data to your development project to avoid double-counting MTUs across projects.
- Use the logic in the code snippet below to switch automatically between the two project tokens when you’re in development or when you’re ready to push data to production.
- Specify your production domain and project tokens.
When to Use Multiple Production Projects
You can choose to send production data from multiple sources (for example, your website and mobile app) to the same Mixpanel project or to two separate projects. It’s up to you to determine which is best for your business, but here are a few tips to help you decide:Factors to Consider
Do you want to track and study cross-platform user behavior?- For example, do you foresee leveraging either platform to convert users to another platform or contributing to the other platform’s retention? Or is it common for users to begin a flow on your web app and complete that flow on your mobile app?
- If so, then you probably do want to study behavior cross-platform and should send the data to the same project. Sending data to two different projects means you won’t be able to easily compare any behavior from the app to the website or vice versa.
- If the purpose and features of your data sources vary widely, you might consider using two different projects and analyzing each separately.
- Sending both types of data to the same project could clutter your analytics for both mobile and web, as having a many unique event and property names from different platforms can clutter the UI and dropdown menus in your Mixpanel project.
Best Practices for Cross-Platform Tracking
Generally speaking, Mixpanel users have more flexibility and get more valuable insights when combining the tracking of multiple platforms into a single project to study their overall user experience across platforms. While we generally recommend sending data from all platforms to a single project, it’s also best practice to create separate development and production projects to avoid cluttering production data with test data, regardless of platform. If you send events from all platforms to one project, you can still differentiate actions taken on your app vs. website via segmentation and filtering using the Operating System property (the Mixpanel JavaScript, iOS, and Android libraries store the Operating System property by default). If you decide to send events from multiple platforms to the same Mixpanel projects, follow these guidelines for the best results:- Make sure events that are the same across platforms are named the same way. For example, you wouldn’t want to create an Event on your website called Sign in and an Event on your app called Log in if they represent the same user action.
- Capitalization matters: calling one event “Purchase” and one “purchase” will show as two different events in your report dropdowns!
- Ensure you’re handling user identity properly so that you can track users across platforms without counting them as a different user on each platform. Learn more about identifying users.
- Advanced tip: You can initialize multiple instances of Mixpanel on the same app to send certain events to their own, different project. This would allow you to send some events to a different project if you have some different functionality on certain platforms and want to analyze that activity separately.