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

Integrate with the latest Google Analytics for Firebase SDK version.

Using Cocoapods

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

pod 'FirebaseAnalytics'
pod 'FirebaseAnalyticsOnDeviceConversion'

or

pod 'FirebaseAnalytics/WithoutAdIdSupport'
pod 'FirebaseAnalyticsOnDeviceConversion'

Then, run the commands pod repo update and pod install.

Alternative integration

If your app does not use Cocoapods, 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 and FirebaseAnalyticsOnDeviceConversion directories.

  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 'FirebaseAnalyticsOnDeviceConversion'
    

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, ensure that a message like the following appears in the Xcode debug console:

9.0.0 - [Firebase/Analytics][I-ACS023007] Analytics v.9.0.0 started
...
9.0.0 - [Firebase/Analytics][I-ACS023009] Debug logging enabled




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