Session Analytics

So, you’ve finished your game. Or more correctly, you’ve released your game – these things never seem to be finished. And unless you’re some sort of psychopath you want to know how well it’s doing. Anxiously checking the number of downloads can only get you so far. A more accurate measure of how well you game is doing is linked to the player session data. Simply put – the more people playing, the better. In essence, we want to remove the clutter from people who have downloaded the game but are no longer playing it.

There are a number of analytics to measure the number of people playing your game. You could get the number of players playing in the moment you want to see the analytics, but that kind of data is very hard to draw concrete patterns from. It’s safe to assume you have more players in the day than in the night, so let’s get the number of players over the course of 24 hours. This is already heaps better than what we had before. Hang on, wouldn’t some players play on weekends and not on weekdays? You’re absolutely right. Maybe we should take players over a week instead of a daily one. Better, but if the majority of our players play on weekends, we only have two days of seven that contribute to our total. As well as playing your game, like to do other things on weekends.(Crazy I know.) If our player base varies week on week, maybe we should change the collection time from a week to a month. This helps mitigate the effects of busy weekends. Common ones you’ll see are daily active users (DAU) and monthly active users (MAU).

So, we have a number for players playing over any day, week or month, but how many can we count on? How many players are just trying out the game then and how many are hooked? Let’s define the question properly: How many players that were playing at time t, are still playing after n days? This your game’s retention or sticking power. We want to discount the new players that joined after time t and any of the players from time t that don’t play after n days. The percentage represents the chance of your game having a long life span and supporting you in the future. For example, No Mans Sky has poor retention and probably won’t make much money in a year, whereas Rocket League continues to make money because they’ve got a high retention in their player base.

Ok, we’ve talked about what the numbers mean, but how do we get them. All of the stuff we’ve talked about has been about who’s playing and at what time. Let’s store the session data in the database. For each session we’ll have a player id, start timestamp and end timestamp. (You can put a unique id in if you want or use a composite key of player id and start timestamp.) With the start and end times of each player we can construct all of the numbers for the analytics we mentioned above. E.g. we can search for players that have a session on a certain day, then find the players that have a session on another day and compare the player ids to get our retention. To get Daily active users we search for players that had one or more sessions between two timestamps 24 hours apart.

How do we fill out this session data? When the game starts, we want to know which player is playing. The game sends up to the server a unique id that it either got from a previous time it started or we give it a new one from our server. Once our player has logged in, we make a new session record with the player id and the current timestamp. Simple, once logging in is handled.

How do we know when the session ended? By it’s definition the game can’t send us data anymore. We need to fill it out before we know the player has finished. Let’s say our game checks in with the server every minute or so, we can update the session data there update the end time of that players latest session to the current timestamp. Now our session data has an end time. Even when our player loses internet connection the session is preserved as best it can be. Note, if the player starts their game offline and then comes online that should be handled when our game checks in with the server so it doesn’t join the last session and this session together. Perhaps keep a logged in flag locally until the game can make contact with the server.

Now with the data and techniques you can see how popular your game is. Unfortunately nothing described here can tell you why it’s not. Sorry.