با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Google Analytics داده های استفاده و رفتار برنامه شما را جمع آوری می کند. SDK دو نوع اصلی اطلاعات را ثبت می کند:
رویدادها: آنچه در برنامه شما اتفاق می افتد، مانند اقدامات کاربر، رویدادهای سیستم یا خطاها.
ویژگی های کاربر: ویژگی هایی که برای توصیف بخش هایی از پایگاه کاربر خود تعریف می کنید، مانند ترجیح زبان یا موقعیت جغرافیایی.
Analytics به طور خودکار برخی رویدادها و ویژگی های کاربر را ثبت می کند. برای فعال کردن آنها نیازی به افزودن کدی ندارید. اگر برنامه شما نیاز به جمعآوری دادههای اضافی دارد، میتوانید حداکثر 25 ویژگی کاربر Analytics مختلف را تنظیم کنید و تا 500 نوع رویداد Analytics مختلف را در برنامه خود ثبت کنید. هیچ محدودیتی در حجم کل رویدادهایی که برنامه شما ثبت می کند وجود ندارد.
برای مشاهده داشبورد گزارش Analytics ، Analytics از منو انتخاب کنید.
برگه رویدادها گزارشهای رویداد را نشان میدهد که بهطور خودکار برای هر نوع متمایز رویداد Analytics ثبتشده توسط برنامه شما ایجاد میشوند. در مورد داشبورد بیشتر بخوانید.
برای کمک به شروع، Analytics SDK تعدادی رویداد توصیه شده را تعریف میکند که در بین انواع مختلف برنامهها، از جمله برنامههای خردهفروشی و تجارت الکترونیک، سفر، و بازی مشترک هستند. برای اطلاعات بیشتر درباره این رویدادها و زمان استفاده از آنها، به رویدادهای توصیه شده مراجعه کنید. برای دریافت حداکثر جزئیات در گزارشها، رویدادهای توصیهشده را که برای برنامه شما و پارامترهای تعیینشده آن معنا دارند، ثبت کنید. این همچنین تضمین می کند که از آخرین ویژگی های Google Analytics به محض در دسترس قرار گرفتن آنها بهره مند شوید.
توجه داشته باشید که افزودن Firebase به پروژه C++ شما شامل وظایفی هم در کنسول Firebase و هم در پروژه C++ باز شما می شود (به عنوان مثال، فایل های پیکربندی Firebase را از کنسول دانلود می کنید، سپس آنها را به پروژه C++ خود منتقل می کنید).
برنامه firebase را ایجاد و مقداردهی اولیه کنید
قبل از شروع، باید برنامه firebase را ایجاد و مقداردهی اولیه کنید:
اندروید
برنامه firebase را ایجاد کنید، محیط jni و یک ارجاع jobject به فعالیت جاوا را به عنوان آرگومان ارسال کنید:
تاریخ آخرین بهروزرسانی 2025-08-15 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-15 بهوقت ساعت هماهنگ جهانی."],[],[],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)."]]