GUI

Unity Application Insights

Application Insights for Unity UI and Mixed Reality

Track Unity UI button event and Mixed Reality event telemetry using Application Insights

Setup

  1. Import Application Insight Plugins into Unity project.
  2. Create new Application Insights service in Azure
  3. Copy and paste your Application Insights Instrumentation Id into the Application Insights Unity scene script.
  4. (Optional) You may also wish to add your App Id and (read only) Key for running Application Insights Query scripts.

How it works

Add one instance of the UnityApplicationInsights scripts into your main Unity scene.

  • Unity scene changes are automically captured as a PageView event.

  • To add logging to Application Insights for Unity UI buttons you can either manually attach the ButtonTrackerBehaviour to the Unity button, or enable the Add Tracker Behaviours setting in the Inspector which will attach the script automatically to all selectable game objects upon scene change.

Application Insights sample scenes

Scene name Description
Scene-UI Unity UI Button event telemetry sample scene
Scene-MR Interactive hologram event sample scene for Mixed Reality

Application Insights visualisations

In Application Insights Usage section you can visualise telemetry logged from your app.

User Flows

Chart user flow across Unity scene changes and split by custom or interaction events.

Application Insights User Flows

Sessions

View users and events during sessions.

applicationinsights-sessions

Funnels

Create funnels by creating step by step conditions to get conversion rates.

applicationinsights-funnels

Custom visualization of Unity UI and MR telemetry

To create custom visualizations using all the data collected by Application Insights you can use the Ibex Dashboard. Fork the project and copy the Unity UI template or MR template file into the server/dashboards/preconfigured directory. You should then be able to create your own dashboard by using these templates in the app.

ibexdashboard-unityui

ibexdashboard-unitymr

Dependencies

Optional dependencies

Optional dependencies are included as git submodules which can be installed after cloning:

git submodule update --init --recursive

The Voronoi selection sample code is commented out inside the Scripts/MR/Tap.cs script.

Voronoi selection is useful in Mixed Reality scenarios for selecting holograms which may be small and close together or even overlap. In relation to capturing telemetry in MR scenarios we might want to capture Air Taps on holograms. But what happens when a user taps on void spaces which may have missed the target. We can log any useful metrics regarding nearest objects to Application Insights or even enable the closest object to be triggered.