تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوضّح لك هذا الدليل كيفية تسجيل الأحداث في تطبيقك.
تقدِّم الأحداث إحصاءات حول ما يحدث في تطبيقك، مثل إجراءات المستخدم أو أحداث النظام أو الأخطاء.
تسجّل Analytics تلقائيًا بعض الأحداث نيابةً عنك، ولست بحاجة إلى إضافة أي رمز لتلقّيها. إذا كان تطبيقك بحاجة إلى جمع بيانات إضافية، يمكنك تسجيل ما يصل إلى 500 Analytics نوع حدث مختلف في تطبيقك، بدون أي حدّ أقصى للحجم الإجمالي للأحداث التي يسجّلها تطبيقك. يُرجى العِلم أنّ أسماء الأحداث حسّاسة لحالة الأحرف، وأنّ تسجيل حدثَين يختلف اسم كل منهما عن الآخر في حالة الأحرف فقط يؤدّي إلى تسجيل حدثَين مختلفَين.
بعد إعداد مثيل
firebase.analytics()،
يمكنك البدء في تسجيل الأحداث باستخدام
الطريقة logEvent(). إذا كنت معتادًا على استخدام Google Analytics، فإنّ هذه الطريقة تعادل استخدام الأمر event في gtag.js.
لمساعدتك في البدء، تحدّد حزمة تطوير البرامج (SDK) في "إحصاءات Google" عددًا من الأحداث المقترَحة الشائعة بين أنواع مختلفة من التطبيقات، بما في ذلك تطبيقات البيع بالتجزئة والتجارة الإلكترونية والسفر والألعاب. لمزيد من المعلومات
عن هذه الأحداث
والحالات المناسبة لاستخدامها، اطّلِع على الأحداث المقترَحة.
ملاحظة: للحصول على أكبر قدر من التفاصيل في التقارير، سجِّل الأحداث المقترَحة التي تتناسب مع تطبيقك ومعلَماتها المحدَّدة. ويضمن ذلك أيضًا استفادتك من أحدث ميزات "إحصاءات Google" عند توفّرها.
يمكنك الاطّلاع على تفاصيل التنفيذ الخاصة بالعديد من الأحداث ومَعلماتها في مرجع أحداث gtag.js.
يوضّح المثال التالي كيفية تسجيل حدث select_content:
بالإضافة إلى المَعلمات المحدّدة، يمكنك إضافة المَعلمات التالية إلى أي حدث:
المَعلمات المخصّصة: يمكن استخدام المَعلمات المخصّصة كـ
سمات أو مقاييس
في تقارير Analytics.
يمكنك استخدام السمات المخصّصة لبيانات مَعلمات الأحداث غير الرقمية، والمقاييس المخصّصة لأي بيانات مَعلمات يمكن تمثيلها بشكل أفضل رقميًا. بعد تسجيل مَعلمة مخصّصة باستخدام حزمة تطوير البرامج (SDK)، سجِّل السمة أو المقياس لضمان ظهور هذه المَعلمات المخصّصة في تقارير "إحصاءات Google". يمكنك إجراء ذلك من خلال: إحصاءات Google > الأحداث > إدارة التعريفات المخصّصة > إنشاء سمات مخصّصة
يمكن استخدام المَعلمات المخصّصة في تعريفات شرائح الجمهور التي يمكن تطبيقها على كل تقرير.
يتم أيضًا تضمين المَعلمات المخصّصة في البيانات التي يتم تصديرها إلى BigQuery إذا كان تطبيقك مرتبطًا بمشروع BigQuery. يمكنك العثور على نماذج طلبات بحث وغير ذلك الكثير
في BigQuery Export في "إحصاءات Google 4".
المَعلمة value: value هي مَعلمة عامة الأغراض ومفيدة لتجميع مقياس رئيسي ذي صلة بحدث معيّن. وتشمل الأمثلة الأرباح والمسافة والوقت والنقاط.
إذا كان تطبيقك يتضمّن احتياجات محدّدة لا يغطيها نوع حدث مقترَح، يمكنك تسجيل أحداثك المخصّصة. على سبيل المثال، إذا كنت بصدد تطوير لعبة وتريد تتبُّع الوقت الذي يحقّق فيه أحد اللاعبين هدفًا معيّنًا، يمكنك تسجيل حدث مشابه للمثال التالي:
يمكنك الاطّلاع على إحصاءات مجمّعة حول أحداثك في لوحات بيانات
Firebase وحدة التحكّم. يتم تعديل لوحات البيانات هذه بشكل دوري على مدار اليوم. لإجراء اختبار فوري، استخدِم ناتج logcat كما هو موضّح في القسم السابق.
يمكنك الوصول إلى هذه البيانات من لوحة بيانات
الأحداث
في وحدة تحكّم Firebase. تعرض لوحة البيانات هذه تقارير الأحداث التي يتم إنشاؤها تلقائيًا لكل نوع مختلف من الأحداث التي يسجّلها تطبيقك.
تاريخ التعديل الأخير: 2025-09-05 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-09-05 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["\u003cbr /\u003e\n\niOS+ Android Web Flutter \n\n\u003cbr /\u003e\n\nThis guide shows you how to log events in your app.\n\n[Events](https://support.google.com/analytics/answer/9322688) provide insight on what is happening in your app, such as user\nactions, system events, or errors.\n\nAnalytics automatically logs some\n[events](https://support.google.com/analytics/answer/9234069) for you; you don't\nneed to add any code to receive them. If your app needs to collect additional\ndata, you can log up to 500 different Analytics Event *types* in your app.\nThere is no limit on the total volume of events your app logs. Note that event\nnames are case-sensitive and that logging two events whose names differ only in\ncase results in two distinct events.\n\nBefore you begin\n\nMake sure that you've set up your project and can access Analytics as described in\n[Get Started with Analytics](/docs/analytics/get-started?platform=web).\n\nLog events\n\nAfter you have configured the\n[`firebase.analytics()`](/docs/reference/js/analytics) instance,\nyou can begin to log events with the\n[`logEvent()`](/docs/reference/js/analytics#logevent)\nmethod. If you're already familiar with Google Analytics, this method is\nequivalent to using the `event` command in\n[gtag.js](https://developers.google.com/gtagjs/).\n\nTo help you get started, the Analytics SDK defines a number of recommended\nevents that are common among different types of apps, including retail and\necommerce, travel, and gaming apps. To learn more\n[about these events](https://support.google.com/analytics/answer/9322688)\nand when to use them, see [Recommended events](https://support.google.com/analytics/answer/9267735).\n\n**Note:** To get the maximum detail in reports, log the recommended events that\nmake sense for your app and their prescribed parameters. This also ensures that\nyou benefit from the latest Google Analytics features as they become available.\n\nYou can find implementation details for several events and their parameters in\nthe\n[gtag.js event reference](https://developers.google.com/gtagjs/reference/event).\n\nThe following example demonstrates how to log a `select_content` event: \n\nWeb \n\n```javascript\nimport { getAnalytics, logEvent } from \"firebase/analytics\";\n\nconst analytics = getAnalytics();\nlogEvent(analytics, 'select_content', {\n content_type: 'image',\n content_id: 'P12453'\n});https://github.com/firebase/snippets-web/blob/467eaa165dcbd9b3ab15711e76fa52237ba37f8b/snippets/analytics-next/index/analytics_log_event_params.js#L8-L14\n```\n\nWeb \n\n```javascript\nanalytics.logEvent('select_content', {\n content_type: 'image',\n content_id: 'P12453',\n items: [{ name: 'Kittens' }]\n});https://github.com/firebase/snippets-web/blob/467eaa165dcbd9b3ab15711e76fa52237ba37f8b/analytics/index.js#L20-L24\n```\n\nIn addition to the prescribed parameters, you can add the following parameters\nto any event:\n\n- Custom parameters: Custom parameters can be used as\n [dimensions or metrics](https://support.google.com/analytics/answer/10075209)\n in [Analytics reports](https://support.google.com/analytics/answer/9212670).\n You can use custom dimensions for non-numerical event parameter data and\n custom metrics for any parameter data better represented numerically. Once\n you've logged a custom parameter using the SDK, register the dimension or\n metric to ensure those custom parameters appear in Analytics\n reports. Do this via: *Analytics \\\u003e Events \\\u003e Manage Custom Definitions \\\u003e\n Create Custom Dimensions*\n\n Custom parameters can be used in\n [audience](https://support.google.com/firebase/answer/6317509)\n definitions that may be applied to every report.\n Custom parameters are also included in data\n [exported to BigQuery](https://support.google.com/firebase/answer/7030014)\n if your app is linked to a BigQuery project. Find sample queries and much more\n at [Google Analytics 4 BigQuery Export](https://developers.google.com/analytics/bigquery).\n- `value` parameter: `value` is a general purpose parameter that is useful for accumulating a key metric that pertains to an event. Examples include revenue, distance, time, and points.\n\nIf your application has specific needs not covered by a recommended event type,\nyou can log your own custom events. For example, if you're developing a game and\nwant to track when a player completes a particular goal, you could log an event\nsimilar to the following example: \n\nWeb \n\n```javascript\nimport { getAnalytics, logEvent } from \"firebase/analytics\";\n\nconst analytics = getAnalytics();\nlogEvent(analytics, 'goal_completion', { name: 'lever_puzzle'});https://github.com/firebase/snippets-web/blob/467eaa165dcbd9b3ab15711e76fa52237ba37f8b/snippets/analytics-next/index/analytics_log_event_custom_params.js#L8-L11\n```\n\nWeb \n\n```javascript\nanalytics.logEvent('goal_completion', { name: 'lever_puzzle'});https://github.com/firebase/snippets-web/blob/467eaa165dcbd9b3ab15711e76fa52237ba37f8b/analytics/index.js#L32-L32\n```\n\nView events in the dashboard\n\nYou can view aggregated statistics about your events in the\nFirebase console dashboards. These dashboards update periodically\nthroughout the day. For immediate testing, use the logcat output as described in\nthe previous section.\n\nYou can access this data from the\n[**Events**](https://console.firebase.google.com/project/_/analytics/events)\ndashboard in the Firebase console. This dashboard shows the event reports\nthat are automatically created for each distinct type of event logged by\nyour app."]]