Step 2: Integrate Google Analytics
Introduction: Measure iOS Ads conversions |
Step 1: Link Your Ads Account with Google Analytics |
Step 2: Integrate Google Analytics |
Step 3: Troubleshoot and handle common issues |
Now that you've linked your Ads account, you can begin integrating the Google Analytics for Firebase SDK.
Integrate the Google Analytics for Firebase SDK
Integrate with the latest Google Analytics for Firebase SDK version.
Use Cocoapods
If your app uses Cocoapods, verify your project's Podfile contains the
GoogleAppAdsOnDeviceConversion
pod, through either the main
FirebaseAnalytics
pod or by including it explicitly as a standalone pod:
pod 'FirebaseAnalytics' # includes GoogleAdsOnDeviceConversion
or
pod 'FirebaseAnalytics/Core'
pod 'GoogleAdsOnDeviceConversion'
Then, run the commands pod repo update
and pod install
.
Use Swift Package Manager
If your app uses Swift Package Manager, follow the steps at
Swift Package Manager for Firebase.
When you reach the step "Choose the Firebase libraries that you want include in
your app", check FirebaseAnalytics
before continuing to the next steps.
Alternatively, check FirebaseAnalytics/Core
and
GoogleAdsOnDeviceConversion
.
Alternative integration
If your app does not use Cocoapods or Swift Package Manager, integrate as follows:
- Download the public zip file of Firebase from the firebase-ios-sdk GitHub repo.
- 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. - In Xcode, add the
-ObjC
and-lc++
flags to Other Linker Settings in your app target's build settings.
Enable debug mode (optional)
Enable debug mode by adding -FIRDebugEnabled
under
Arguments Passed on Launch in Xcode's scheme editor.
Upon launching the app in Xcode, verify that a message like the following appears in the Xcode debug console:
[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
Wait around 15 seconds and verify that the _psmvalue_gads
message appears in
the Xcode debug console:
[FirebaseAnalytics][I-ACS023087] User property set. Name, value: _psmvalue_gads, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Google Analytics Step 1 Link Your Ads Account with Step 3: Troubleshoot and handle common issues