بعد أن نفّذت نظام مصادقة لجمع عناوين البريد الإلكتروني
أو أرقام هواتف المستخدمين، يمكنك البدء في دمج حزمة تطوير البرامج (SDK) Google Analytics ل
Firebase.
دمج حزمة تطوير البرامج (SDK) لنظام Google Analytics في Firebase
أجرِ عملية الدمج مع أحدث إصدار من حزمة تطوير البرامج (SDK) لمنصّة Google Analytics.
استخدام Cocoapods
إذا كان تطبيقك يستخدم Cocoapods، تأكَّد من أنّ ملف Podfile الخاص بمشروعك يحتوي على أيّ مما يلي:
pod 'FirebaseAnalytics` # includes GoogleAdsOnDeviceConversion
أو
pod 'FirebaseAnalytics/Core'
pod 'GoogleAdsOnDeviceConversion'
بعد ذلك، نفِّذ الأمرَين pod repo update وpod install.
استخدام أداة إدارة حِزم Swift
إذا كان تطبيقك يستخدم Swift Package Manager، اتّبِع الخطوات الواردة في مقالة
Swift Package Manager لـ Firebase.
عند الوصول إلى الخطوة "اختيار مكتبات Firebase التي تريد تضمينها في
تطبيقك"، ضَع علامة في المربّع FirebaseAnalytics قبل المتابعة إلى الخطوات التالية.
بدلاً من ذلك، يمكنك وضع علامة في المربّع FirebaseAnalytics/CoreوGoogleAdsOnDeviceConversion.
الدمج البديل
إذا كان تطبيقك لا يستخدم Cocoapods أو Swift Package Manager، يمكنك دمج الرمز على النحو التالي:
اختَر نظام التشغيل iOS في ملف > إعدادات الإنشاء، ثم انقر على
إنشاء وتشغيل.
في مجلد الإنشاء الذي تم إنشاؤه، ابحث عن Podfile وأضِف ما يلي:
pod 'GoogleAdsOnDeviceConversion'
تفعيل وضع تصحيح الأخطاء (اختياري)
فعِّل وضع تصحيح الأخطاء عن طريق إضافة -FIRDebugEnabled ضمن "الوسيطات التي تم تمريرها عند الإطلاق"
في محرِّر المخطّط في Xcode. عند تشغيل التطبيق في Xcode، تأكَّد من ظهور
رسالة مثل ما يلي في وحدة تحكّم تصحيح الأخطاء في Xcode:
[Firebase/Analytics][I-ACS023007] Analytics v.x.x.x started
...
[Firebase/Analytics][I-ACS023009] Debug logging enabled
تاريخ التعديل الأخير: 2025-09-06 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-06 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["Step 2: Integrate Google Analytics\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------------------------------|\n| Introduction: [Measure iOS Ads conversions](/docs/tutorials/ads-ios-on-device-measurement/index-first-party) |\n| Step 1: [Implement a sign-in experience](/docs/tutorials/ads-ios-on-device-measurement/step-1) \u003cbr /\u003e |\n| **Step 2: Integrate Google Analytics** \u003cbr /\u003e |\n| Step 3: [Initiate on-device conversion measurement using Google Analytics](/docs/tutorials/ads-ios-on-device-measurement/step-3) |\n| Step 4: [Troubleshoot and handle common issues](/docs/tutorials/ads-ios-on-device-measurement/step-4) |\n\n\u003cbr /\u003e\n\nNow that you've implemented an authentication system to collect users' emails\nor phone numbers, you can begin integrating the Google Analytics for\nFirebase SDK.\n\nIntegrate the Google Analytics for Firebase SDK\n\nIntegrate with the latest Google Analytics for Firebase SDK version.\n| **Note:** `GoogleAdsOnDeviceConversion` is not subject to [Apple's privacy manifest requirements](https://developer.apple.com/news/?id=3d8a9yyh) and does not include a privacy manifest. No additional action is required to enable on-device conversion measurement.\n\nUse Cocoapods\n\nIf your app uses Cocoapods, ensure your project's Podfile contains either: \n\n pod 'FirebaseAnalytics` # includes GoogleAdsOnDeviceConversion\n\nor \n\n pod 'FirebaseAnalytics/Core'\n pod 'GoogleAdsOnDeviceConversion'\n\nThen, run the commands `pod repo update` and `pod install`.\n\nUse Swift Package Manager\n\nIf your app uses Swift Package Manager, follow the steps at\n[Swift Package Manager for Firebase](/docs/ios/installation-methods#swift-package-manager).\nWhen you reach the step \"Choose the Firebase libraries that you want include in\nyour app\", check `FirebaseAnalytics` before continuing to the next steps.\nAlternatively, check `FirebaseAnalytics/Core` *and*\n`GoogleAdsOnDeviceConversion`.\n\nAlternative integration\n\nIf your app does not use Cocoapods or Swift Package Manager, integrate as\nfollows:\n\n1. Download the public zip file of Firebase from the [firebase-ios-sdk GitHub repo](https://github.com/firebase/firebase-ios-sdk/releases).\n2. Follow the README instructions from the public zip file to add the frameworks to the project directly. Be sure to add the frameworks from the `FirebaseAnalytics` directory.\n3. In Xcode, add the `-ObjC` and `-lc++` flags to \"Other Linker Settings\" in your app target's build settings.\n\nUnity\n\n1. Add the [Firebase Unity SDK](/download/unity)\n (specifically, `FirebaseAnalytics.unitypackage`) to your Unity project. More detailed instructions can be found in [Add Firebase Unity SDKs](https://firebase.google.com/docs/unity/setup#add-sdks).\n\n2. Select the platform iOS at **File** \\\u003e **Build Settings** , then click\n **Build and Run**.\n\n3. In the generated build folder, locate the Podfile and add the following:\n\n pod 'GoogleAdsOnDeviceConversion'\n\nEnable debug mode (optional)\n\nEnable debug mode by adding `-FIRDebugEnabled` under \"Arguments Passed on Launch\"\nin Xcode's scheme editor. Upon launching the app in Xcode, ensure that a\nmessage like the following appears in the Xcode debug console: \n\n [Firebase/Analytics][I-ACS023007] Analytics v.x.x.x started\n ...\n [Firebase/Analytics][I-ACS023009] Debug logging enabled\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\u003cbr /\u003e\n\n[arrow_back_ios**Step 1**: Implement a sign-in experience](/docs/tutorials/ads-ios-on-device-measurement/step-1)\n[**Step 3** : Initiate measurements using Google Analyticsarrow_forward_ios](/docs/tutorials/ads-ios-on-device-measurement/step-3)\n\n\u003cbr /\u003e\n\n*** ** * ** ***"]]