Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

110
Views
Basic usage of Google Analytics Plugin for Unity3D

I'm trying to get analytics from a mobile app developed in Unity3D using Google Analytics Plugin for Unity. I've tried the simplest program, it doesn't throw errors but 48 hours later there's no data in Google Analytics dashboards. Here's the complete example:

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour {
    public GoogleAnalyticsV4 ga;
    public UnityEngine.UI.Text myText;
    private void Start() {
        try {
            ga.StartSession();
            ga.LogScreen("MAIN_SCREEN");
            myText.text = $"<b>No errors</b>";
        }
        catch (Exception e) {
            myText.text = $"<b>{e}</b>";
        }
    }
}

If there's a more suitable option than the Google Analytics Plugin for Unity it would be great to know it.

Any help would be greatly appreciated.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Finally I found the error. In google analytics for Unity3D you must have a Universal analytics property (UA-XXXXXXX-1) I always tried it without it and, obviously, it didn't work.

Once you has the object properly initialized in your inspector, you need to create your script to call analytics functions. I don't know if always is needed but I have to call other function in addition to startSession. As the code I pasted in the question I also called a LogScreen and then I started to recieve information in my GoogleAnalytics.

ga.StartSession();
ga.LogScreen("MAIN_SCREEN");

If someone has the same issue I leave here the support page where indicates how get an Universal Analytics property

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!