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

What Process mining Is, and How It Augments Your Automation Journey

[Leet Code] Count the Number of Consistent Strings

Exclusivity Enforcement in Swift 5

Azure DevOps — Pipelines

A Comprehensive Guide to Managing Web Development Projects

A comprehensive comparison between Jupyter Notebook and Apache Zeppelin

What is SAFe® for DevOps Course?

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

Write Up Horizontall machine HTB

LinkedIn GAN Network Analysis

Refresher on Plus Expected Value (EV) Betting

Super Bowl LVI (2022): Who Will Win the Big Game?