# Integrated Conversion Measurement

[Integrated Conversion Measurement](https://support.google.com/google-ads/answer/16203286) uses the On Device Measurement (ODM):
Event Data SDK to enhance measurement for iOS conversions. You can access the
ODM SDK from the following sources:

- [Firebase iOS SDK 11.14.0+](https://firebase.google.com/support/release-notes/ios#version_11140_-_june_3_2025)
- [Swift Package Manager](https://github.com/googleads/google-ads-on-device-conversion-ios-sdk)
- [CocoaPods](https://github.com/googleads/google-ads-on-device-conversion-ios-sdk/blob/main/GoogleAdsOnDeviceConversion.podspec)

Learn more about [implementing on-device conversion measurement with a standalone SDK](https://support.google.com/google-ads/answer/16384720).

The following steps outline how to leverage the ODM SDK.

## Integrate the standalone SDK

You can access the ODM standalone SDK using CocoaPods and Swift Package Manager.

### Swift Package Manager

1. In Xcode, go to **File** , then **Add Packages**.
2. Select the [GoogleAdsOnDeviceConversion GitHub repository](https://github.com/googleads/google-ads-on-device-conversion-ios-sdk) in the prompt.

After you're finished, Xcode will begin resolving your package dependencies
and downloading them in the background.

### CocoaPods

1. Add the GoogleAdsOnDeviceConversion pod to your Podfile.

   ```ruby
   pod 'GoogleAdsOnDeviceConversion'
   ```
2. Run `pod install --repo-update`.

## Use the On Device Measurement (ODM): Event Data SDK

Once you retrieve the ODM SDK, fetch the conversion info shortly after the app
first launches, preceding the `first_open` conversion event being sent to the
App Conversion API.

### Swift

1. Import `GoogleAdsOnDeviceConversion`.

   ```swift
   import GoogleAdsOnDeviceConversion
   ```
2. Set the time when the app was first launched.

   ```swift
   ConversionManager.sharedInstance.setFirstLaunchTime(Date())
   ```
3. Fetch the conversion info.

   ```swift
   ConversionManager.sharedInstance.fetchAggregateConversionInfo(
       for: .installation) { aggregateConversionInfo, error in
      guard error == nil else { return }
      guard let info = aggregateConversionInfo else { return }
      guard info.count > 0 else { return }
      print("Conversion info \(info)")
   }
   ```

To troubleshoot:

1. Check that the Date passed to `setFirstLaunchTime()` was when the app first launched.
2. Check that your app is running in an approved region.

Use info as the value in the `odm_info` query parameter in the App
Conversion API. For example, if the info is "abcdEfadGdaf", then
`odm_info=abcdEfadGdaf`.

### Objective-C

1. Import `GoogleAdsOnDeviceConversion`.

   ```objective-c
   @import GoogleAdsOnDeviceConversion;
   ```
2. Set the time when the app was first launched.

   ```objective-c
   [[ODCConversionManager sharedInstance] setFirstLaunchTime:[NSDate date]];
   ```
3. Fetch the conversion info.

   ```objective-c
   [[ODCConversionManager sharedInstance]
     fetchAggregateConversionInfoForInteraction:ODCInteractionTypeInstallation
     completion:^(NSString * _Nullable aggregateConversionInfo,
                  NSError * _Nullable error)
   {
     if (error) {
       return;
     }
     if (aggregateConversionInfo.length == 0) {
       return;
     }

     NSLog(@"Conversion info %@", aggregateConversionInfo);

     // Use aggregateConversionInfo as the value in the odm_info query
     // parameter in the App Conversion API.
     // For example, if aggregateConversionInfo is "abcdEfadGdaf",
     // then odm_info=abcdEfadGdaf.
   }];
   ```

To troubleshoot:

1. Check that the NSDate passed to `setFirstLaunchTime()` was when the app first launched.
2. Check that your app is running in an approved region.