Tracking custom events
Unity Analytics does a number of different things automatically to make it easy to work with; however, as a game designer, you may often want to check whether certain aspects of the game are being used or whether players are reaching certain pieces of content. To keep a track on this, we can make use of the Custom Events system.
Custom Events are pieces of data that users send to the cloud as they play the game. Each custom event can have its own parameters, which will allow us to filter the data that we send when it occurs.
Using the AnalyticsTracker component
Now, one of the simplest ways to track when something occurs is through the editor itself, making use of the Analytics Tracker (Script)
component. For example, perform the following steps when you want to track whether players are using the Pause menu.
- Open the Gameplay scene by going to the
Project
window and then to theAssets\Scenes
folder. From there, double-click on theGameplay
scene. - From the
Hierarchy
window...