Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Google Analytics recopila datos de uso y comportamiento de tu app. El SDK registra dos tipos principales de información:
Eventos: Lo que sucede en la app, como las acciones de los usuarios, los eventos del sistema o los errores.
Propiedades de usuario: Los atributos que defines para describir segmentos de tu base de usuarios, como la preferencia de idioma o la ubicación geográfica.
Analytics registra automáticamente algunos eventos y propiedades del usuario; no es necesario que agregues código para habilitarlos. Si necesitas recopilar datos adicionales para la app, puedes configurar hasta 25 propiedades de usuario de Analytics diferentes y registrar hasta 500 tipos distintos de eventos de Analytics en la app. No existen límites para el volumen total de eventos que registra la app.
Selecciona Analytics en el menú para ver el panel de informes de Analytics.
En la pestaña Eventos, se muestran los informes de eventos
que se crean automáticamente para cada tipo de evento de Analytics que registra
tu app. Obtén más información sobre el panel.
Para ayudarte a comenzar, el SDK de Analytics define una
cantidad de eventos recomendados que son comunes entre diferentes tipos de apps, como las de
venta minorista y comercio electrónico, viajes y videojuegos. Para obtener más información sobre estos eventos y cuándo usarlos, consulta Eventos recomendados.
Para obtener el máximo nivel de detalle en los informes, registra
los eventos recomendados que sean relevantes para la app junto con sus
parámetros prescritos. De esta manera, también te aseguras de beneficiarte de las funciones más recientes de Google Analytics a medida que estén disponibles.
Antes de comenzar
Antes de poder usar Google Analytics, tendrás que hacer lo siguiente:
Registra tu proyecto de C++ y configúralo para que use Firebase.
Si tu proyecto de C++ ya usa Firebase, significa que ya está registrado y configurado para esa plataforma.
Ten en cuenta que agregar Firebase a un proyecto de C++ implica realizar tareas en Firebase console y en el proyecto abierto de C++ (por ejemplo, descargar archivos de configuración de Firebase desde la consola y transferirlos al proyecto de C++).
Crea e inicializa la app de Firebase
Antes de comenzar, deberás crear la app de Firebase e inicializarla:
Android
Para crear la app de Firebase, pasa como argumentos el entorno de JNI y una referencia de jobject a la actividad de Java:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 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 recommended 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 C++ project and configure it to use Firebase.\n\n If your C++ project already uses Firebase, then it's already registered and\n configured for Firebase.\n- Add the [Firebase C++ SDK](/download/cpp) to your C++ project.\n\n| **Find detailed instructions for these initial\n| setup tasks in\n| [Add Firebase to your C++\n| project](/docs/cpp/setup#note-select-platform).**\n\nNote that adding Firebase to your C++ project involves tasks both in the\n[Firebase console](//console.firebase.google.com/) and in your open C++ project (for example, you download\nFirebase config files from the console, then move them into your C++ project).\n\nCreate and initialize the firebase app\n\nBefore you start, you'll need to create and initialize the firebase App: \n\nAndroid\n\nCreate the firebase app, passing the jni environment and a `jobject`\nreference to the java activity as arguments: \n\n```c++\napp = ::firebase::App::Create(::firebase::AppOptions(), jni_env, activity);\n```\n\nInitialize the Analytics library: \n\n```c++\n::firebase::analytics::Initialize(app);\n```\n\n\u003cbr /\u003e\n\niOS+\n\nCreate the firebase app: \n\n```c++\napp = ::firebase::App::Create(::firebase::AppOptions());\n```\n\nInitialize the Analytics library: \n\n```c++\n::firebase::analytics::Initialize(app);\n```\n\n\u003cbr /\u003e\n\nLog events\n\nAfter you have configured the [`firebase::App`](/docs/reference/cpp/class/firebase/app) instance, you can\nbegin to log events with the [`LogEvent()`](/docs/reference/cpp/namespace/firebase/analytics#logevent) method.\n\nThe following example updates the user's score: \n\n```c++\nanalytics::LogEvent(analytics::kEventPostScore, analytics::kParameterScore, 42);\n```\n| **Note:** Once 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/cpp/events) and [user properties](/docs/analytics/cpp/properties)."]]