How to use analytics in Unity

Let’s go over how to enable and use analytics in Unity.

First, open the Services window, click on Analytics and then enable:

To view analytics events click on “Go to dashboard”. In older versions of Unity it was possible to view the events in the editor but that has now been removed:

Open up the script you want to track events on and add the using directive UnityEngine.Analytics:

Add a public function for the event and add Analytics.CustomEvent with a suitable description:

Lastly, add the script to a buttons OnClick event:

Good luck!




Unity / C# Game developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

[Golang] How To Use Message Broker In Golang

AWS Cloud Value Proposition

Learning HTML Through Codecademy

Don’t do programming

Learning how to code

Rusty Shorts — Smart Pointers

Staging, Testing, Devo. Forget it.

Prim’s Algorithm using MST

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Niklas Bergstrand

Niklas Bergstrand

Unity / C# Game developer

More from Medium

Journey of a home-maker to a machine learning Algorithm developer

How to Create a Time Machine

The Power of a (programming) language

Improvisation over planning