'Sup guys?
If there’s one thing that I’ve learned interning at Roblox for the past couple of weeks, it’s that data is extremely important to collect. One of my side projects was to create a system that allowed me to answer the questions I had about my games, like “Where are players dying?”, “How many players are (not) getting through the tutorial?” and even “What is the average solve time of this puzzle?” Enter: Mixpanel. It’s data analysis software which tracks events and user engagements. Typically, this is used on a website using JavaScript or an Android/iOS application. I decided to implement it on Roblox.
What kinds of questions could possibly be answered? Well…
- Where are players falling off the map in my obstacle course?
- What types of guns are players using in my FPS?
- How much damage does a new player do in one lifetime in my FPS, compared to an old player?
- What maps do players vote on the most in my round-based game?
- How many rounds of my dodgeball game are happening per hour? How long do they last?
- Are players buying products from me more often with shop design A or shop design B?
What tracking can it do out-of-the-box?
- Server starts/closes
- Visits/leaves and session times
- Spawns/deaths, and positional data
- Purchases
- Player locations (using zones you define, the void y<-250 is defined by default)
What’s the API like?
The API for tracking your own stuff is as simple as a couple lines of code. Here’s sending one event associated with a server:
MixpanelStandard.track("Round started") MixpanelStandard.trackPlayer(player, "Pressed button") MixpanelStandard.trackPlayer(player, "Bought item", { ["Item name"] = "Cool sword", ["Item price"] = 200 })
Sample graphs
Here’s a couple of things Mixpanel can show you. This is data I’ve collected using Mixpanel in Mirror Muse, my accelerator project:
Note on the user location profiling: It’s using IP addresses of Roblox’s game servers to determine location. This is inaccurate data and because we don’t have players’ IP addresses, we cannot track player locations. Ignore it.
Bonus graph: Here’s a pie chart of the number of deaths for each punch type in my side project, Fisticuffs:
What’s the catch?
You can’t track everything. You have a limited number of data points for use with your Mixpanel account (25,000/mo, increased to 200,000/mo if you put their logo on your website). This should be plenty for small-ish games depending on what you’re tracking. It costs $150 for 500,000 data points per month and that is the lowest tier (at the time of this posting). Mixpanel have excellent support staff and are more than happy to help you figure out what kind of data you want to track. I’ve spoken with their support staff a number of times. If you’re making more than $1,000 a month from your game, it is definitely a worthwhile investment.
When you try out the tracking code, you’ll want to disable some of the included tracking scripts that aren’t relevant to your game. These are described in the README. Mixpanel recommends to start small, so start with Server starts/closes, Visits, and maybe one custom event like rounds.
I want to play with this!
- Go register a Mixpanel account. It’s free and there’s zero commitment. You don’t need multiple accounts for more than one game.
- Here’s the ModuleScripts and basic tracking scripts all included!
- Here’s a Wiki article on getting set up.
- Here’s Mixpanel’s website. Read about the tracking that it does.
- Here’s Mixpanel’s API reference which is how I built the module with HttpService.
Some other notes
The conclusions that can be drawn from data you collect in your game can be insanely useful for making effective updates to your game. Being able to see when players are leaving your game is a very valuable tool. If you’re losing 10% of your players in the first 10 minutes of play, that could mean the difference between a front-page game and a flop. So should you try Mixpanel?
1/17/2016 Update:
I’ve made the following improvements to the library after having used Mixpanel for longer.