Tutorial: Measure iOS Ads conversions

Step 2: Integrate Google Analytics


Introduction: Measure iOS Ads conversions

Step 1: Implement a sign-in experience


Step 2: Integrate Google Analytics

Step 3: Initiate on-device conversion measurement using Google Analytics
Step 4: Troubleshoot and handle common issues


Now that you've implemented an authentication system to collect users' emails or phone numbers, you can begin integrating the Google Analytics for Firebase SDK.

Integrate the Google Analytics for Firebase SDK

To use On-Device Conversion Measurement with First-Party Data as described in this tutorial, you must use version 11.14.0 or higher of the Google Analytics for Firebase SDK for Apple platforms. Ensure your project dependencies are updated accordingly. For detailed information about the included SDK modules and configurations, refer to Target capabilities.

Use Cocoapods

If your app uses Cocoapods, ensure your project's Podfile contains either:

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:

  1. Download the public zip file of Firebase from the firebase-ios-sdk GitHub repo.
  2. 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.
  3. In Xcode, add the -ObjC and -lc++ flags to Other Linker Settings in your app target's build settings.

Unity

  1. Add the Firebase Unity SDK (specifically, FirebaseAnalytics.unitypackage) to your Unity project. More detailed instructions can be found in Add Firebase Unity SDKs.

  2. Select the platform iOS at File > Build Settings, then click Build and Run.

  3. In the generated build folder, locate the Podfile and add the following:

    pod 'GoogleAdsOnDeviceConversion'
    

Enable debug mode

Enable debug mode by adding -FIRDebugEnabled under Arguments Passed on Launch in Xcode's scheme editor. Upon launching the app in Xcode, ensure 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




Step 1: Implement a sign-in experience Step 3: Initiate measurements using Google Analytics