Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Google Analytics mengumpulkan data penggunaan dan perilaku untuk aplikasi Anda. SDK
mencatat dua jenis informasi utama ke dalam log:
Peristiwa: Hal-hal yang terjadi dalam aplikasi Anda, seperti tindakan pengguna, peristiwa
sistem, atau error.
Properti pengguna: Atribut yang Anda tentukan untuk mendeskripsikan segmen
basis pengguna, seperti preferensi bahasa atau lokasi geografis.
Analytics secara otomatis mencatat beberapa
peristiwa dan
properti pengguna ke dalam log.
Anda tidak perlu menambahkan kode apa pun untuk mengaktifkannya. Jika aplikasi Anda perlu mengumpulkan
data tambahan, Anda dapat menyiapkan hingga 25 properti pengguna Analytics yang berbeda
dan mencatat hingga 500 jenis peristiwa Analytics yang berbeda ke dalam log di aplikasi.
Tidak ada batasan pada volume total peristiwa yang dicatat oleh aplikasi Anda ke dalam log.
Pilih Analytics dari menu untuk melihat dasbor pelaporan
Analytics.
Tab Events menampilkan laporan peristiwa yang
secara otomatis dibuat untuk setiap jenis peristiwa Analytics yang berbeda yang dicatat ke dalam log oleh
aplikasi Anda. Baca lebih lanjut tentang dasbor.
Untuk membantu Anda memulai, Analytics SDK menetapkan sejumlah
peristiwa yang direkomendasikan yang biasa dipakai di berbagai jenis aplikasi, termasuk
aplikasi retail dan e-commerce, perjalanan, dan game. Untuk mempelajari lebih lanjut tentang peristiwa ini
dan waktu penggunaannya, lihat Peristiwa yang direkomendasikan.
Untuk mendapatkan detail yang maksimal dalam laporan, buat log
peristiwa yang direkomendasikan yang sesuai untuk aplikasi Anda, beserta
parameternya yang ditetapkan. Hal ini juga akan memastikan bahwa Anda mendapatkan keuntungan
dari fitur Google Analytics terbaru saat tersedia.
Perlu diperhatikan bahwa penambahan Firebase ke project C++ Anda memerlukan tindakan baik di
Firebase console maupun di project C++ yang terbuka (misalnya, Anda mendownload
file konfigurasi Firebase dari konsol, lalu memindahkannya ke project C++).
Membuat dan menginisialisasi aplikasi Firebase
Sebelum memulai, Anda harus membuat dan menginisialisasi aplikasi Firebase:
Android
Buat aplikasi Firebase, dengan meneruskan lingkungan jni dan referensi
jobject ke Java Activity sebagai argumen:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-05 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)."]]