بعد ربط حسابك على "إعلانات Google"، يمكنك البدء في دمج حزمة تطوير البرامج (SDK) للخدمة
Google Analytics لمنصّة Firebase.
دمج حزمة تطوير البرامج (SDK) لنظام Google Analytics في Firebase
أجرِ عملية الدمج مع أحدث إصدار من حزمة تطوير البرامج (SDK) لمنصّة Google Analytics.
استخدام Cocoapods
إذا كان تطبيقك يستخدم Cocoapods، تأكَّد من أنّ ملف Podfile الخاص بمشروعك يحتوي على حِزمة
GoogleAppAdsOnDeviceConversion، إما من خلال حِزمة
FirebaseAnalytics الرئيسية أو عن طريق تضمينها صراحةً كحِزمة مستقلة:
pod'FirebaseAnalytics'# includes GoogleAdsOnDeviceConversion
بعد ذلك، نفِّذ الأمرَين pod repo update وpod install.
استخدام أداة إدارة حِزم Swift
إذا كان تطبيقك يستخدم Swift Package Manager، اتّبِع الخطوات الواردة في مقالة
Swift Package Manager لـ Firebase.
عند الوصول إلى الخطوة "اختيار مكتبات Firebase التي تريد تضمينها في
تطبيقك"، ضَع علامة في المربّع FirebaseAnalytics قبل المتابعة إلى الخطوات التالية.
بدلاً من ذلك، يمكنك التحقق من FirebaseAnalytics/CoreوGoogleAdsOnDeviceConversion.
الدمج البديل
إذا كان تطبيقك لا يستخدم Cocoapods أو Swift Package Manager، يمكنك دمج الرمز على النحو التالي:
تاريخ التعديل الأخير: 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-event-data/index-event-driven) |\n| Step 1: [Link Your Ads Account with Google Analytics](/docs/tutorials/ads-ios-on-device-measurement-event-data/step-1) |\n| **Step 2: Integrate Google Analytics** \u003cbr /\u003e |\n| Step 3: [Troubleshoot and handle common issues](/docs/tutorials/ads-ios-on-device-measurement-event-data/step-3) |\n\n\u003cbr /\u003e\n\nNow that you've linked your Ads account, you can begin integrating the\nGoogle Analytics for Firebase 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\n| requirements](//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, verify your project's Podfile contains the\n`GoogleAppAdsOnDeviceConversion` pod, through either the main\n`FirebaseAnalytics` pod or by including it explicitly as a standalone pod: \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\nEnable debug mode (optional)\n\nEnable debug mode by adding `-FIRDebugEnabled` under\n**Arguments Passed on Launch** in Xcode's scheme editor.\n\nUpon launching the app in Xcode, verify that a message like the following\nappears 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 [FirebaseAnalytics][I-ACS023278] Conversion service GoogleAdsOnDeviceConversion framework is linked\n\nWait around 15 seconds and verify that the `_psmvalue_gads` message appears in\nthe Xcode debug console: \n\n [FirebaseAnalytics][I-ACS023087] User property set. Name, value: _psmvalue_gads, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n\n| **Note:** This message won't appear for users/devices located in the European Economic Area (EEA), the United Kingdom, and Switzerland.\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\u003cbr /\u003e\n\n[arrow_back_ios**Step 1** Link Your Ads Account with Google Analytics](/docs/tutorials/ads-ios-on-device-measurement-event-data/step-1)\n[**Step 3** : Troubleshoot and handle common issuesarrow_forward_ios](/docs/tutorials/ads-ios-on-device-measurement-event-data/step-3)\n\n\u003cbr /\u003e\n\n*** ** * ** ***"]]