Analytics Custom Events- App Dev Series 15
Objective: using Unity Analytics to track the app usage data from users.
When published a guiding app, you must be so desperate to know what option of your app is that users selected the most.
We can use Unity Analytics to analysis the usage of our app.
Enable Analytics
To start using Analytics, click Windows from drop down menu of Unity, then select Services.
It would open Services window tab besides Inspector.
Then select Analytics and enable it.
So simple to be ready to use this service.
Custom Event
Now we need to create a function under Analytics called Custom Event.
First we need to create a script.
As I would like to analysis the data of button clicking on different animals, I would create a public method to it.
Inside this method, we would use AnalyticsEvent.Custom to track the data on button clicking.
We need to give this event a name, and event data by using Dictionary.
Let’s tracking the separate buttons by their name, and keep a time parameter to track how long does user click that button since app started.
After done setting this button-clicking event, we can add a AnalyticsResult to track down the status of using Analytics.
Finished setting! Let’s back to editor and test this out.
Analytics result on Dashboard
Back to editor, assign the script to the button or any object you would like to call the analytics.
Once you play the app and click or call the method, it should show the result of analytics in the Console.
And we can go to the Dashboard of our app to see the analytics data.
However it would need to take hours to reveal in Dashboard, you should check it later.