Make your Game Better with Unity Analytics!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we're going to learn how to quickly set up your project using unity analytics this lets you improve your game by analyzing how your players are actually playing your game let's begin hello and welcome i'm your code monkey and this channel is all about helping you learn how to make your own games with in-depth tutorials made by a professional indie game developer so if you find the video helpful consider subscribing okay so this is going to be a short video since it's extremely easy to add now over here i have my demo scene it's just a basic platformer so i have my character and i can move around and jump i covered basic jumping in another video if you want to know how it works and over here there are some hazards like this fire pit and over here there's a spike so if i touch them yep there you go i die and i can click a button to restart my level then if i keep going at the end level if there you go there's a nice star and if i touch it yep there you go i won the level then click on continue and now i'm on a different level and so on and all the mechanics are all the same this video is made possible thanks to these awesome supporters go to patreon.com codemonkey to get some perks and help keep the videos free for everyone all right so that's my demo setup just a pretty basic platformer okay so let's set up our analytics now like i said it's extremely easy we just go all the way up here to window go into general and open up the services tab right here so here first of all we need to create the unity project id so just select an organization and hit on create and right away the project has been created so we can see all the ent services that we can use so there's lots of different services that can help you develop your game in this one we're focused on the analytics so in here just click on it and yep analytics so you can figure out where your players get frustrated how to improve them and so on so just click on enable and then just asks you if your target is children chances are it is not so just leave it unticked and click on continue okay so in order to get some basic functionality this is literally all there is to it just press the button enable analytics and yep there you go everything is working so if i start playing right now as soon as i hit play then some basic analytics are sent so now again on the services window we can open up analytics and click the button to go to the dashboard so this opens up your browser and goes directly to the unity dashboard and over here is where you will see all the various stats now one thing about the data is that it takes up to one day to show up on the dashboard so right now it shows up as empty even though we already were in the game once so in one day this will be updated with all the stats in case you have multiple projects you can go up here in order to select the actual project that you set in this case it's this one okay so this is the analytics overview then here we can go into the data explorer and here we can view the default stats so right away in here we can click in order to visualize the daily active users monthly active users then there's also sessions per user and in case you enable monetization you also see a whole bunch of monetization revenue stats so this is the type of data and then down here is the segment so this allows you to further drill down and actually identify the type of data that you're looking for so by default just by pressing a button we already have quite a lot of data to improve our game so we could see our retention and compare it with either all users or just a couple of countries we could check out the number of daily active users per android or for ios and so on so lots of data already here however we want to expand upon it so let's learn how we can handle custom events okay so here we are back in our game now the first thing we need is to actually think about what we want to keep track so what sort of data would be useful for improving our game now in this simple example the obvious answers are tracking deaths and wins so let's start with the simple one of tracking wins now there are two ways we can send events we can do it through code or through a component so personally i prefer sending them through code but i'll also cover the component in a bit now over here i have my basic player script and then down here we are testing for the 11 win and levels so essentially the star game object contains a star component so just testing for the collision and it collides and there you go level one so just some pretty basic stuff and it's in here that we want to fire our custom event so for that let's go all the way up here and we're going to add using unity engine dot analytics then we can go down here and we're going to add analytics and call custom event and all we need is to pass a name for our custom event so in this case let's say level win then let's add our current level so i have just a basic static class in here and holds an inum for the level so i can just use this function down here to get the current level and that's what we use all right so this will be triggered whenever i win a level and then tell me which level we want now this function here returns a analytic result so this is just a basic in home with a bunch of possible values so in most cases what you should be getting is just a simple okay so we can analog to test so in here let's capture that so we grab the result and then we simply print it okay so let's try and i want to win so let's jump in jump in and go through this one and yep no window level all right great and over here in the console yep we can see indeed analytics result okay so this is telling us that our custom event has been correctly sent all right awesome now with this function call all we did was just send a basic event so essentially just a string however we have another function where we can send in a dictionary so here this one takes a custom event name and this one takes a custom event name as well as our dictionary so alternatively instead of sending a string composed of the level win and the number we can send the name of the event as level 1 and then we pass in a dictionary so let's create a new dictionary of type string object okay so we're calling custom event passing in the string level 1 then we're passing in a dictionary and a dictionary takes a string key and then an object so for the string key let's call it our level and the actual value will be the same level all right so just like this it should be working let's test okay here we are and let's try to win and if there you go we have our ok so once again our analytics is being correctly sent and in this case it's being sent along with a dictionary okay so that's just one way to send events through code now let me just quickly cover sending events through a component now for that let's create an empty game object and then down here we can add the component and we go into analytics and we add the analytics event tracker so here you can see a whole bunch of events for when the event will be triggered so based on its lifecycle based on a ui or a timer so for example we could choose lifecycle and then say on start then we would say send event then let's say level win and then we could add some parameters so let's say the level in this case let's say the level one so essentially this would send the exact same event that we sent through code except it would be sent through here and should be sent when this game object is created so for example we would make this a prefab and instantiate it when the player touches the start so that's how you send events through a basic component without touching the code now like i said i personally prefer to do it all through code but here's the other option and it's up to you alright so now for the other thing we want to track it's deaths so here we have the platform script and again this is when he hits the star and wins and this is when he hits either a lava or a spike where he dies so here let's fire off pretty much a similar event so we can just copy this except in this case it's not a level win but a level died and then again we can pass in the same dictionary with level and show the current level so with this we would gather some stats on how many times a player died on a specific level and again over here we have a dictionary so this is not limited to just one extra value i believe the total maximum is 10 so we can add various parameters in here so for example we have a level in which the player died and then we can also add another one and here let's say we want to keep track of the position and now over here we can ask ourselves an interesting question which is what would be the best type of data that we could send in order to make it easy to analyze and further improve our game so in here we could send a vector3 however doing so would require making some extra tools in order to actually analyze that data since every vector 3 would be very different so instead what we can do is just some basic math and split up our level into various sections since the game is a platformer the player is pretty much always moving just left to right so we could essentially so in this case it's very easy to split our level into pretty much some vertical slices so here we take this transform position which is the player position then let's say we divide by 20 units and we round this value so essentially for every 10 units on the horizontal axis we're going to have a different section so here we can create a new game object just to visually see all right over there we have our position so if the player were to die in here on position 10 then it would die on section 0 then if it died over here on let's say position 65 then to be tagged as a death on the section 3 and so on so this is just an example as to how you should think about what type of data you're actually storing in order to make the best decisions using that data okay so that's pretty much it we have a custom event we give it a name we pass in the level where this event was fired and also the position where the event was fired so with this we know on which level the player died and roughly where on that level he died okay so let's test and see if our result is okay okay so here we are let's move forward and yep i falled i died and yep there you go and if i look in the console there's the ok result alright so everything seems to be working and now with all the data correctly set up now this would be the time to send your game to some testers in order to get some data and after you've correctly set up your analytics you need to wait a couple of hours to about a day for those sets to show up in the dashboard alright so here i am one day or later and we can view the stats so on the data explorer you can see that it did indeed update so a dau is a daily active user it was just me playing the game so yep just one and now that we have some data we can go on the event manager and over here we see all of our custom events so the first one we sent was the string level win underscore one and then we start sending just level and level down and each of these you can see has various parameters so we've got the level with each level and then the position which we slice the level into various positions so we can see that the custom events are correctly being sent and over here on the data explorer we can click on this to open up some custom events and now let's say 11 died for all current users and let's put it by a level and just like this in there we can see all the stats so we can see for example that there were only one deaths on level three there were three deaths on level two and eleven that's on level one so for example let's assume we want our game to be somewhat casual and not meant to be a hardcore platformer so this tells us that there were way too many that's on level one so using this data we would now know okay we should probably rebalance this level to make it slightly easier so you can add as many custom events as you want and search for them using any of the parameters that you sent now on the rest of the dashboard you also have the funnel analyzer so here this helps you identify where the players drop off so you can see a bunch of preset funnel templates so for example track whenever the user does something new track when monetization happens when people watch ads or so on or you can just create a new funnel and here you can give the funnel a name so let's say a level of progression and then you can add the various events that make up this funnel so for example we would track level win then over here the parameter on one and equals in this case we used an inum to define our levels and it's underscore one so on the first part of the funnel we would go through a win on level one then we'd go win on level two so just like this we have a funnel that will show us where the players drop off our game here is the funnel rate setup and now in our case since i did go through all three levels we can see a hundred percent but for example let's say that only half of the players actually went through level one so level one would be at 100 and everything else would be at less than that so using this we can very easily see where our players are dropping off now there's always a natural drop off but we can analyze it to see if the drop-off that we get is the expected one or if players are dropping off way too much you can create any type of funnels based on the events you are capturing so the element for the system is really just your imagination then here we also have the segments part and here you can separate your audience into groups to better analyze your stats so by default you have all these segments so for example you have all the current users so this is everyone who used the app in the last 90 days then we see a bunch of them based on life cycle so what happens to the users on the first three days and so on then we have a bunch of geography things a bunch of monetization and also our platforms and once again you can also create new segments and you can add custom events and here go as detailed as you want then down here we also have market insights so here we can see a bunch of data on the current state of the market you have stats for mobile and also for standalone so for example here on standalone we can see that the majority of people has multiple cores then down here we can see that most of them are on windows and we can also see that quite a lot of people are using 1080p however there's still a significant portion of people using smaller resolutions so this tells you do not ignore those people and make sure your game and all of its text is either adaptable or can be read at small resolutions and for mobile we also see tons of data so you can see all the various aspect ratios here we see the platform split with android taking a huge chunk and the various vendors that make up all of those users so here you can see tons of data on the current side of the market which will help you make decisions to make your game the best it can be and lastly we have the raw data export so this is where you get the raw analytics data which you can then use to make your own custom analysis and visualizations you can export as json or as tsv and that makes up unity analytics as you saw only took was a single button press we enabled the basic analytics and then we expand upon that with custom events to track specific things in our game then using that custom data we were able to improve the game by identifying a specific point where the difficulty curve was too steep so the end result of all this is a better game for everyone if you found this video helpful consider liking and subscribing this video is made possible thanks to these awesome supporters go to patreon.com unitycodemonkey to get some perks and help keep the videos free for everyone as always you can download the project files and utilities from mintycodemonk.com subscribe to the channel for more unt tutorials post any questions i have in comments and i'll see you next time
Info
Channel: Code Monkey
Views: 34,934
Rating: undefined out of 5
Keywords: unity analytics, unity analytics tutorial, unity analytics event tracker, unity analytics 2020, unity analytics custom events, unity analytics dashboard, unity analytics api, code monkey, unity tutorial, unity game tutorial, unity tutorial for beginners, unity 2d tutorial, unity 3d, unity, game design, game development, game dev, game development unity, unity 2d, unity 3d tutorial, programming, coding, c#, code, software development, learn programming, unity tutorials
Id: 3jDD-E1OUkc
Channel Id: undefined
Length: 15min 40sec (940 seconds)
Published: Fri Aug 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.