Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
O Google Analytics coleta dados de uso e comportamento do seu app. O SDK
registra dois tipos principais de informações:
Eventos: o que acontece no seu app, como ações do usuário, eventos
do sistema ou erros.
Propriedades do usuário: atributos que você define para descrever segmentos da sua
base de usuários, como preferência de idioma ou localização geográfica.
O Analytics registra automaticamente alguns
eventos e
propriedades do usuário.
Não é preciso adicionar códigos para ativá-los. Caso o app precise coletar
outros dados, é possível configurar até 25 propriedades de usuário do Analytics
e registrar até 500 tipos de eventos Analytics dessa plataforma no app.
Não há limite para o volume total de eventos registrados pelo app.
Selecione Analytics no menu para acessar o painel de relatórios
Analytics.
A guia Eventos mostra os relatórios de eventos criados automaticamente para cada tipo distinto de evento do Analytics registrado pelo seu aplicativo. Leia mais sobre o painel.
Para ajudar você a começar, o SDK do Analytics define vários
eventos recomendados, comuns entre diferentes tipos de apps, como os de
varejo, e-commerce, viagem e jogos. Para saber mais
sobre esses eventos
e quando usar cada um, consulte
Eventos recomendados.
Para criar relatórios mais detalhados, registre
os eventos sugeridos do Analytics que se aplicam ao seu app e os
parâmetros prescritos para eles. Isso também garante que você aproveite os recursos mais recentes do Google Analytics conforme eles são disponibilizados.
registrar seu projeto do Unity e configurá-lo para usar o Firebase.
Se o projeto do Unity já usa o Firebase, ele já está registrado e configurado para essa plataforma.
Se você não tiver um projeto do Unity, faça o download de um
app de exemplo.
Adicione o SDK do Firebase para Unity (especificamente FirebaseAnalytics.unitypackage) ao
seu projeto do Unity.
Adicionar o Firebase ao projeto do Unity envolve tarefas no
Console do Firebase e no projeto aberto do Unity.
Por exemplo, fazer o download dos arquivos de configuração do Firebase no console e
mover para o projeto do Unity.
Registrar eventos
Comece a registrar eventos imediatamente com o método
LogEvent().
O exemplo a seguir registra eventos com vários tipos de argumentos:
// Log an event with no parameters.Firebase.Analytics.FirebaseAnalytics.LogEvent(Firebase.Analytics.FirebaseAnalytics.EventLogin);// Log an event with a float parameterFirebase.Analytics.FirebaseAnalytics.LogEvent("progress","percent",0.4f);// Log an event with an int parameter.Firebase.Analytics.FirebaseAnalytics.LogEvent(Firebase.Analytics.FirebaseAnalytics.EventPostScore,Firebase.Analytics.FirebaseAnalytics.ParameterScore,42);// Log an event with a string parameter.Firebase.Analytics.FirebaseAnalytics.LogEvent(Firebase.Analytics.FirebaseAnalytics.EventJoinGroup,Firebase.Analytics.FirebaseAnalytics.ParameterGroupId,"spoon_welders");// Log an event with multiple parameters, passed as a struct:Firebase.Analytics.Parameter[]LevelUpParameters={newFirebase.Analytics.Parameter(Firebase.Analytics.FirebaseAnalytics.ParameterLevel,5),newFirebase.Analytics.Parameter(Firebase.Analytics.FirebaseAnalytics.ParameterCharacter,"mrspoon"),newFirebase.Analytics.Parameter("hit_accuracy",3.14f)};Firebase.Analytics.FirebaseAnalytics.LogEvent(Firebase.Analytics.FirebaseAnalytics.EventLevelUp,LevelUpParameters);
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Não contém as informações de que eu preciso","missingTheInformationINeed","thumb-down"],["Muito complicado / etapas demais","tooComplicatedTooManySteps","thumb-down"],["Desatualizado","outOfDate","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Problema com as amostras / o código","samplesCodeIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 UTC."],[],[],null,["Google Analytics collects usage and behavior data for your app. The SDK\nlogs two primary types of information:\n\n- **Events:** What is happening in your app, such as user actions, system events, or errors.\n- **User properties:** Attributes you define to describe segments of your user base, such as language preference or geographic location.\n\nAnalytics automatically logs some\n[events](https://support.google.com/analytics/answer/9234069) and\n[user properties](https://support.google.com/analytics/answer/9268042);\nyou don't need to add any code to enable them. If your app needs to collect\nadditional data, you can set up to 25 different Analytics user properties\nand log up to 500 different Analytics event *types* in your app.\nThere is no limit on the total volume of events your app logs.\n\nTo access this data:\n\n1. In the [Firebase console](//console.firebase.google.com/), open your project.\n2. Select **Analytics** from the menu to view the Analytics reporting dashboard.\n\nThe **Events** tab shows the event reports that are\nautomatically created for each distinct type of Analytics event logged by\nyour app. Read more about the [dashboard](https://support.google.com/analytics/answer/11014767).\n\nTo help you get started, the Analytics SDK defines a number of\nrecommended events that are common among different types of apps, including\nretail and ecommerce, travel, and gaming apps. To learn more about these events\nand when to use them, see [Recommended events](https://support.google.com/analytics/answer/9267735).\nTo get the maximum detail in reports, log\nthe suggested Analytics events that make sense for your app and their\nprescribed parameters. This also ensures that you benefit from the latest\nGoogle Analytics features as they become available.\n\nBefore you begin\n\nBefore you can use\n[Google Analytics](/docs/reference/unity/namespace/firebase/analytics),\nyou need to:\n\n- Register your Unity project and configure it to use Firebase.\n\n - If your Unity project already uses Firebase, then it's already\n registered and configured for Firebase.\n\n - If you don't have a Unity project, you can download a\n [sample app](//github.com/google/mechahamster).\n\n- Add the [Firebase Unity SDK](/download/unity) (specifically, `FirebaseAnalytics.unitypackage`) to\n your Unity project.\n\n| **Find detailed instructions for these initial\n| setup tasks in\n| [Add Firebase to your Unity project](/docs/unity/setup#prerequisites).**\n\nNote that adding Firebase to your Unity project involves tasks both in the\n[Firebase console](//console.firebase.google.com/) and in your open Unity project\n(for example, you download Firebase config files from the console, then move\nthem into your Unity project).\n\nLog events\n\nYou can immediately begin to log events with the\n[`LogEvent()`](/docs/reference/unity/class/firebase/analytics/firebase-analytics#logevent) method.\n\nThe following example logs events with various types of arguments: \n\n```c#\n// Log an event with no parameters.\nFirebase.Analytics.FirebaseAnalytics\n .LogEvent(Firebase.Analytics.FirebaseAnalytics.EventLogin);\n\n// Log an event with a float parameter\nFirebase.Analytics.FirebaseAnalytics\n .LogEvent(\"progress\", \"percent\", 0.4f);\n\n// Log an event with an int parameter.\nFirebase.Analytics.FirebaseAnalytics\n .LogEvent(\n Firebase.Analytics.FirebaseAnalytics.EventPostScore,\n Firebase.Analytics.FirebaseAnalytics.ParameterScore,\n 42\n );\n\n// Log an event with a string parameter.\nFirebase.Analytics.FirebaseAnalytics\n .LogEvent(\n Firebase.Analytics.FirebaseAnalytics.EventJoinGroup,\n Firebase.Analytics.FirebaseAnalytics.ParameterGroupId,\n \"spoon_welders\"\n );\n\n// Log an event with multiple parameters, passed as a struct:\nFirebase.Analytics.Parameter[] LevelUpParameters = {\n new Firebase.Analytics.Parameter(\n Firebase.Analytics.FirebaseAnalytics.ParameterLevel, 5),\n new Firebase.Analytics.Parameter(\n Firebase.Analytics.FirebaseAnalytics.ParameterCharacter, \"mrspoon\"),\n new Firebase.Analytics.Parameter(\n \"hit_accuracy\", 3.14f)\n};\nFirebase.Analytics.FirebaseAnalytics.LogEvent(\n Firebase.Analytics.FirebaseAnalytics.EventLevelUp,\n LevelUpParameters);\n```\n| **Note:** After the property is registered, it can take up to 24 hours for data collected with the property to be included in reports. When the new data is available, the user property can be used as a report filter.\n\nNext Steps\n\n- See your data refresh periodically in the [Firebase console](//console.firebase.google.com/).\n- Explore the guides on [events](/docs/analytics/unity/events) and [user properties](/docs/analytics/unity/properties)."]]