Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

112
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda