אחרי שמקשרים את חשבון Google Ads, אפשר להתחיל לשלב את Google Analytics for Firebase SDK.
שילוב של Google Analytics ל-Firebase SDK
לשלב את הגרסה האחרונה של Google Analytics ל-Firebase SDK.
שימוש ב-Cocoapods
אם האפליקציה שלכם משתמשת ב-Cocoapods, עליכם לוודא ש-Podfile של הפרויקט מכיל את ה-pod GoogleAppAdsOnDeviceConversion, דרך ה-pod הראשי FirebaseAnalytics או על ידי הכללה מפורשת שלו כ-pod עצמאי:
pod'FirebaseAnalytics'# includes GoogleAdsOnDeviceConversion
לאחר מכן, מריצים את הפקודות pod repo update ו-pod install.
שימוש ב-Swift Package Manager
אם האפליקציה שלכם משתמשת ב-Swift Package Manager, פועלים לפי השלבים המפורטים במאמר Swift Package Manager ל-Firebase.
כשמגיעים לשלב 'בחירת ספריות Firebase שרוצים לכלול באפליקציה', מסמנים את התיבה FirebaseAnalytics לפני שממשיכים לשלבים הבאים.
לחלופין, אפשר לבדוק את FirebaseAnalytics/CoreוגםGoogleAdsOnDeviceConversion.
שילוב חלופי
אם האפליקציה שלכם לא משתמשת ב-Cocoapods או ב-Swift Package Manager, מבצעים את השילוב באופן הבא:
פועלים לפי ההוראות במסמך README בקובץ ה-zip הציבורי כדי להוסיף את המסגרות ישירות לפרויקט. חשוב להוסיף את המסגרות מהספרייה FirebaseAnalytics.
ב-Xcode, מוסיפים את הדגלים -ObjC ו--lc++ לקטע Other Linker Settings (הגדרות אחרות של קישור) בהגדרות ה-build של יעד האפליקציה.
מפעילים את מצב ניפוי הבאגים (אופציונלי)
כדי להפעיל את מצב ניפוי הבאגים, מוסיפים את הערך -FIRDebugEnabled בקטע Arguments Passed on Launch (ארגומנטים שהועברו בזמן ההפעלה) בעורך התוכנית של Xcode.
כשמריצים את האפליקציה ב-Xcode, מוודאים שמופיעה הודעה כמו זו במסוף ניפוי הבאגים של Xcode:
[Firebase/Analytics][I-ACS023007] Analytics v.X.X.X started
...
[Firebase/Analytics][I-ACS023009] Debug logging enabled
...
[FirebaseAnalytics][I-ACS023278] Conversion service GoogleAdsOnDeviceConversion framework is linked
ממתינים כ-15 שניות ומוודאים שההודעה _psmvalue_gads מופיעה במסוף ניפוי הבאגים של Xcode:
[FirebaseAnalytics][I-ACS023087] User property set. Name, value: _psmvalue_gads, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[[["התוכן קל להבנה","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-07-24 (שעון UTC)."],[],[],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*** ** * ** ***"]]