Repository: capawesome-team/capacitor-firebase
Pull request #852: feat(analytics): add initiateOnDeviceConversionMeasurement for iOS
Author: login: rencsikmarian
Created: 2025-04-10T10:00:44Z | Merged: 2025-04-16T09:30:04Z

## Pull request checklist

Please check if your PR fulfills the following requirements:

- [x] The changes have been tested successfully.
- [x] A changeset has been created (`npm run changeset`).
- [x] I have read and followed the [pull request guidelines](https://capawesome.io/contributing/pull-requests/).

Close #851

Linked issue #851: feat(analytics): ios add option for `Analytics.initiateOnDeviceConversionMeasurement`
### Plugin(s)

- [x] Analytics
- [ ] App
- [ ] App Check
- [ ] Authentication
- [ ] Crashlytics
- [ ] Cloud Firestore
- [ ] Cloud Functions
- [ ] Cloud Messaging
- [ ] Cloud Storage
- [ ] Performance
- [ ] Remote Config

### Current problem

I'm using Firebase Analytics in a Capacitor iOS app and would like to utilize the `Analytics.initiateOnDeviceConversionMeasurement(emailAddress: "example@gmail.com") / Analytics.initiateOnDeviceConversionMeasurement(phoneNumber: "+15555555555")` method provided by Firebase. This is particularly useful for improving campaign measurement accuracy and complying with Apple's privacy guidelines.

### Preferred solution

Add a new method in the CapacitorFirebaseAnalytics plugin:

`CapacitorFirebaseAnalytics.initiateOnDeviceConversionMeasurement(email: "example@gmail.com") / CapacitorFirebaseAnalytics.initiateOnDeviceConversionMeasurement(phone: "+15555555555") `
This should internally call Firebase's iOS SDK method:

`Analytics.initiateOnDeviceConversionMeasurement(emailAddress: "example@gmail.com") / Analytics.initiateOnDeviceConversionMeasurement(phoneNumber: "+15555555555")`
which is available as of Firebase 10.3.0 (Feb 2023).
[Official docs](https://greentube.atlassian.net/browse/APPEX-988?focusedCommentId=2326232)

Add the ability to hash with SHA256 the email/phone number.

`Analytics.initiateOnDeviceConversionMeasurement(hashedEmailAddress: hashedEmailAddress) / Analytics.initiateOnDeviceConversionMeasurement(hashedPhoneNumber: hashedPhoneNumber)`

CapacitorFirebaseAnalytics plugin:
`CapacitorFirebaseAnalytics.initiateOnDeviceConversionMeasurement(hashedEmail: hashedEmailAddress) / CapacitorFirebaseAnalytics.initiateOnDeviceConversionMeasurement(hashedPhone: hashedPhoneNumber) `

[initiateOnDeviceConversionMeasurement](https://firebase.google.com/docs/tutorials/ads-ios-on-device-measurement/step-3)

### Alternative options

Currently, developers have to write custom native code in Xcode, which breaks plugin abstraction and adds maintenance overhead.

### Additional context

This method is iOS-only and should be guarded with platform checks. It's useful for enhancing user acquisition attribution, especially in the context of SKAdNetwork.

### Before submitting

- [x] I have read and followed the [feature request guidelines](https://capawesome.io/contributing/feature-requests/).
- [x] I have attached links to possibly related issues and discussions.
Linked issue comments: user: login: robingenz
created_at: 2025-04-09T08:45:52Z
body: Thank you for creating this issue. Feel free to submit a PR for this.
author_association: MEMBER
user: login: gcarpi
created_at: 2025-04-10T12:25:43Z
body: @rencsikmarian I need this feature too, I can try to develop it. 
author_association: NONE

Diff:
diff --git a/.changeset/witty-balloons-punch.md b/.changeset/witty-balloons-punch.md
new file mode 100644
index 000000000..bf8bff844
--- /dev/null
+++ b/.changeset/witty-balloons-punch.md
@@ -0,0 +1,5 @@
+---
+'@capacitor-firebase/analytics': minor
+---
+
+feat(analytics): support `initiateOnDeviceConversionMeasurement` on iOS
diff --git a/packages/analytics/CapacitorFirebaseAnalytics.podspec b/packages/analytics/CapacitorFirebaseAnalytics.podspec
index 124986714..5e36acfab 100644
--- a/packages/analytics/CapacitorFirebaseAnalytics.podspec
+++ b/packages/analytics/CapacitorFirebaseAnalytics.podspec
@@ -23,6 +23,7 @@ Pod::Spec.new do |s|
 
   s.subspec 'Analytics' do |analytics|
     analytics.dependency 'FirebaseAnalytics', '~> 11.7.0'
+    analytics.dependency 'GoogleAppMeasurementOnDeviceConversion', '~> 11.7.0'
   end
 
   s.subspec 'AnalyticsWithoutAdIdSupport' do |analyticsWithoutAdIdSupport|
diff --git a/packages/analytics/Package.swift b/packages/analytics/Package.swift
index 80dbcb0bb..ff6f8bf2c 100644
--- a/packages/analytics/Package.swift
+++ b/packages/analytics/Package.swift
@@ -20,7 +20,8 @@ let package = Package(
                 .product(name: "Capacitor", package: "capacitor-swift-pm"),
                 .product(name: "Cordova", package: "capacitor-swift-pm"),
                 .product(name: "FirebaseAnalytics", package: "firebase-ios-sdk"),
-                .product(name: "FirebaseCore", package: "firebase-ios-sdk")
+                .product(name: "FirebaseCore", package: "firebase-ios-sdk"),
+                .product(name: "GoogleAppMeasurementOnDeviceConversion", package: "firebase-ios-sdk")
             ],
             path: "ios/Plugin"),
         .testTarget(
diff --git a/packages/analytics/README.md b/packages/analytics/README.md
index ce630686c..75434d02e 100644
--- a/packages/analytics/README.md
+++ b/packages/analytics/README.md
@@ -134,6 +134,10 @@ const resetAnalyticsData = async () => {
 * [`setEnabled(...)`](#setenabled)
 * [`isEnabled()`](#isenabled)
 * [`resetAnalyticsData()`](#resetanalyticsdata)
+* [`initiateOnDeviceConversionMeasurementWithEmailAddress(...)`](#initiateondeviceconversionmeasurementwithemailaddress)
+* [`initiateOnDeviceConversionMeasurementWithPhoneNumber(...)`](#initiateondeviceconversionmeasurementwithphonenumber)
+* [`initiateOnDeviceConversionMeasurementWithHashedEmailAddress(...)`](#initiateondeviceconversionmeasurementwithhashedemailaddress)
+* [`initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(...)`](#initiateondeviceconversionmeasurementwithhashedphonenumber)
 * [Interfaces](#interfaces)
 * [Enums](#enums)
 
@@ -314,6 +318,82 @@ Only available for Android and iOS.
 --------------------
 
 
+### initiateOnDeviceConversionMeasurementWithEmailAddress(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithEmailAddress(options: InitiateOnDeviceConversionMeasurementWithEmailAddressOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with an email address.
+
+Only available for iOS.
+
+| Param         | Type                                                                                                                                                  |
+| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithemailaddressoptions">InitiateOnDeviceConversionMeasurementWithEmailAddressOptions</a></code> |
+
+**Since:** 7.2.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithPhoneNumber(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithPhoneNumber(options: InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a phone number.
+
+Only available for iOS.
+
+| Param         | Type                                                                                                                                                |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithphonenumberoptions">InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions</a></code> |
+
+**Since:** 7.2.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithHashedEmailAddress(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithHashedEmailAddress(options: InitiateOnDeviceConversionMeasurementWithHashedEmailAddressOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a hashed email address.
+
+Only available for iOS.
+
+| Param         | Type                                                                                                                                                              |
+| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithhashedemailaddressoptions">InitiateOnDeviceConversionMeasurementWithHashedEmailAddressOptions</a></code> |
+
+**Since:** 7.2.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(options: InitiateOnDeviceConversionMeasurementWithHashedPhoneNumberOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a hashed phone number.
+
+Only available for iOS.
+
+| Param         | Type                                                                                                                                                            |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithhashedphonenumberoptions">InitiateOnDeviceConversionMeasurementWithHashedPhoneNumberOptions</a></code> |
+
+**Since:** 7.2.0
+
+--------------------
+
+
 ### Interfaces
 
 
@@ -384,6 +464,34 @@ Only available for Android and iOS.
 | **`enabled`** | <code>boolean</code> | 0.1.0 |
 
 
+#### InitiateOnDeviceConversionMeasurementWithEmailAddressOptions
+
+| Prop               | Type                | Description                                                          | Since |
+| ------------------ | ------------------- | -------------------------------------------------------------------- | ----- |
+| **`emailAddress`** | <code>string</code> | The email address to initiate on-device conversion measurement with. | 7.2.0 |
+
+
+#### InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions
+
+| Prop              | Type                | Description                                                         | Since |
+| ----------------- | ------------------- | ------------------------------------------------------------------- | ----- |
+| **`phoneNumber`** | <code>string</code> | The phone number to initiate on-device conversion measurement with. | 7.2.0 |
+
+
+#### InitiateOnDeviceConversionMeasurementWithHashedEmailAddressOptions
+
+| Prop                     | Type                | Description                                                          | Since |
+| ------------------------ | ------------------- | -------------------------------------------------------------------- | ----- |
+| **`emailAddressToHash`** | <code>string</code> | The email address to initiate on-device conversion measurement with. | 7.2.0 |
+
+
+#### InitiateOnDeviceConversionMeasurementWithHashedPhoneNumberOptions
+
+| Prop                    | Type                | Description                                                         | Since |
+| ----------------------- | ------------------- | ------------------------------------------------------------------- | ----- |
+| **`phoneNumberToHash`** | <code>string</code> | The phone number to initiate on-device conversion measurement with. | 7.2.0 |
+
+
 ### Enums
 
 
diff --git a/packages/analytics/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/analytics/FirebaseAnalyticsPlugin.java b/packages/analytics/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/analytics/FirebaseAnalyticsPlugin.java
index 863a7514d..ee11dc433 100644
--- a/packages/analytics/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/analytics/FirebaseAnalyticsPlugin.java
+++ b/packages/analytics/android/src/main/java/io/capawesome/capacitorjs/plugins/firebase/analytics/FirebaseAnalyticsPlugin.java
@@ -177,4 +177,24 @@ public void resetAnalyticsData(PluginCall call) {
             call.reject(exception.getMessage());
         }
     }
+
+    @PluginMethod
+    public void initiateOnDeviceConversionMeasurementWithEmailAddress(PluginCall call) {
+        call.unimplemented("Not implemented on Android.");
+    }
+
+    @PluginMethod
+    public void initiateOnDeviceConversionMeasurementWithPhoneNumber(PluginCall call) {
+        call.unimplemented("Not implemented on Android.");
+    }
+
+    @PluginMethod
+    public void initiateOnDeviceConversionMeasurementWithHashedEmailAddress(PluginCall call) {
+        call.unimplemented("Not implemented on Android.");
+    }
+
+    @PluginMethod
+    public void initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(PluginCall call) {
+        call.unimplemented("Not implemented on Android.");
+    }
 }
diff --git a/packages/analytics/ios/Plugin/FirebaseAnalytics.swift b/packages/analytics/ios/Plugin/FirebaseAnalytics.swift
index 0593e1970..936d2c191 100644
--- a/packages/analytics/ios/Plugin/FirebaseAnalytics.swift
+++ b/packages/analytics/ios/Plugin/FirebaseAnalytics.swift
@@ -59,4 +59,20 @@ import FirebaseAnalytics
     @objc public func resetAnalyticsData() {
         Analytics.resetAnalyticsData()
     }
+
+    @objc public func initiateOnDeviceConversionMeasurement(email: String) {
+        Analytics.initiateOnDeviceConversionMeasurement(emailAddress: email)
+    }
+
+    @objc public func initiateOnDeviceConversionMeasurement(phone: String) {
+        Analytics.initiateOnDeviceConversionMeasurement(phoneNumber: phone)
+    }
+
+    @objc public func initiateOnDeviceConversionMeasurement(hashedEmail: Data) {
+        Analytics.initiateOnDeviceConversionMeasurement(hashedEmailAddress: hashedEmail)
+    }
+
+    @objc public func initiateOnDeviceConversionMeasurement(hashedPhone: Data) {
+        Analytics.initiateOnDeviceConversionMeasurement(hashedPhoneNumber: hashedPhone)
+    }
 }
diff --git a/packages/analytics/ios/Plugin/FirebaseAnalyticsHelper.swift b/packages/analytics/ios/Plugin/FirebaseAnalyticsHelper.swift
index f89703cc1..3f47a0a44 100644
--- a/packages/analytics/ios/Plugin/FirebaseAnalyticsHelper.swift
+++ b/packages/analytics/ios/Plugin/FirebaseAnalyticsHelper.swift
@@ -1,5 +1,6 @@
 import Foundation
 import FirebaseAnalytics
+import CommonCrypto
 
 public class FirebaseAnalyticsHelper {
     public static func mapStringToConsentType(_ value: String?) -> ConsentType? {
@@ -27,4 +28,80 @@ public class FirebaseAnalyticsHelper {
             return nil
         }
     }
+
+    /**
+     * Normalizes email addresses according to Google Analytics API requirements before SHA256 hashing.
+     * See: https://firebase.google.com/docs/tutorials/ads-ios-on-device-measurement/step-3#use-hashed-credentials
+     * 
+     * The normalization process:
+     * 1. Converts email to lowercase
+     * 2. Replaces @googlemail.com with @gmail.com
+     * 3. For @gmail.com addresses:
+     *    - Removes all periods from username
+     *    - Replaces i, I, 1 with l
+     *    - Replaces 0 with o
+     *    - Replaces 2 with z 
+     *    - Replaces 5 with s
+     *
+     * Examples: 
+     * - an.email.user0125@googlemail.com -> anemalluserolzs@gmail.com
+     * - CAPSUSER0125@provider.net -> capsuser0125@provider.net
+     */
+    public static func normalizeEmail(_ email: String) -> String {
+        var normalized = email.lowercased()
+        
+        if normalized.hasSuffix("@googlemail.com") {
+            normalized = normalized.replacingOccurrences(of: "@googlemail.com", with: "@gmail.com")
+        }
+        
+        if normalized.hasSuffix("@gmail.com") {
+            let components = normalized.components(separatedBy: "@")
+            if components.count == 2 {
+                var username = components[0]
+                
+                username = username.replacingOccurrences(of: ".", with: "")
+                
+                username = username.replacingOccurrences(of: "i", with: "l")
+                username = username.replacingOccurrences(of: "I", with: "l")
+                username = username.replacingOccurrences(of: "1", with: "l")
+                username = username.replacingOccurrences(of: "0", with: "o")
+                username = username.replacingOccurrences(of: "2", with: "z")
+                username = username.replacingOccurrences(of: "5", with: "s")
+                
+                normalized = username + "@gmail.com"
+            }
+        }
+        
+        return normalized
+    }
+
+    public static func isValidEmail(_ email: String) -> Bool {
+        let pattern = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
+        let regex = try? NSRegularExpression(pattern: pattern)
+        let range = NSRange(location: 0, length: email.utf16.count)
+        return regex?.firstMatch(in: email, range: range) != nil
+    }
+    
+    /**
+    * See: https://firebase.google.com/docs/tutorials/ads-ios-on-device-measurement/step-3#use-hashed-credentials
+     * Note: For phone numbers, they must be in E.164 format before hashing:
+     * - Must start with +
+     * - 1-3 digits for country code
+     * - Max 12 digits for subscriber number
+     */
+    public static func isValidE164PhoneNumber(_ phoneNumber: String) -> Bool {
+        let pattern = "^\\+[0-9]{1,3}[0-9]{1,12}$"
+        let regex = try? NSRegularExpression(pattern: pattern)
+        let range = NSRange(location: 0, length: phoneNumber.utf16.count)
+        return regex?.firstMatch(in: phoneNumber, range: range) != nil
+    }
+    
+    public static func sha256(_ string: String) -> Data {
+        let data = string.data(using: .utf8)!
+        var hash = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH))
+        data.withUnsafeBytes {
+            _ = CC_SHA256($0.baseAddress, CC_LONG(data.count), &hash)
+        }
+        return Data(hash)
+    }
 }
diff --git a/packages/analytics/ios/Plugin/FirebaseAnalyticsPlugin.swift b/packages/analytics/ios/Plugin/FirebaseAnalyticsPlugin.swift
index 82f78b895..27b8e18a3 100644
--- a/packages/analytics/ios/Plugin/FirebaseAnalyticsPlugin.swift
+++ b/packages/analytics/ios/Plugin/FirebaseAnalyticsPlugin.swift
@@ -21,7 +21,11 @@ public class FirebaseAnalyticsPlugin: CAPPlugin, CAPBridgedPlugin {
         CAPPluginMethod(name: "setSessionTimeoutDuration", returnType: CAPPluginReturnPromise),
         CAPPluginMethod(name: "setEnabled", returnType: CAPPluginReturnPromise),
         CAPPluginMethod(name: "isEnabled", returnType: CAPPluginReturnPromise),
-        CAPPluginMethod(name: "resetAnalyticsData", returnType: CAPPluginReturnPromise)
+        CAPPluginMethod(name: "resetAnalyticsData", returnType: CAPPluginReturnPromise),
+        CAPPluginMethod(name: "initiateOnDeviceConversionMeasurementWithEmailAddress", returnType: CAPPluginReturnPromise),
+        CAPPluginMethod(name: "initiateOnDeviceConversionMeasurementWithPhoneNumber", returnType: CAPPluginReturnPromise),
+        CAPPluginMethod(name: "initiateOnDeviceConversionMeasurementWithHashedEmailAddress", returnType: CAPPluginReturnPromise),
+        CAPPluginMethod(name: "initiateOnDeviceConversionMeasurementWithHashedPhoneNumber", returnType: CAPPluginReturnPromise)
     ]
     public let errorUserIdMissing = "userId must be provided."
     public let errorKeyMissing = "key must be provided."
@@ -30,6 +34,12 @@ public class FirebaseAnalyticsPlugin: CAPPlugin, CAPBridgedPlugin {
     public let errorEnabledMissing = "enabled must be provided."
     public let errorConsentTypeMissing = "consentType must be provided."
     public let errorConsentStatusMissing = "consentStatus must be provided."
+    public let errorEmailAddressMissing = "emailAddress must be provided."
+    public let errorInvalidEmailFormat = "Invalid email format. Please provide a valid email address."
+    public let errorPhoneNumberMissing = "phoneNumber must be provided."
+    public let errorEmailAddressToHashMissing = "emailAddressToHash must be provided."
+    public let errorPhoneNumberToHashMissing = "phoneNumberToHash must be provided."
+    public let errorInvalidPhoneNumberFormat = "Invalid phone number format. Please provide a valid E.164 formatted phone number."
     private var implementation: FirebaseAnalytics?
 
     override public func load() {
@@ -114,4 +124,59 @@ public class FirebaseAnalyticsPlugin: CAPPlugin, CAPBridgedPlugin {
         implementation?.resetAnalyticsData()
         call.resolve()
     }
+
+    @objc func initiateOnDeviceConversionMeasurementWithEmailAddress(_ call: CAPPluginCall) {
+        guard let emailAddress = call.getString("emailAddress") else {
+            call.reject(errorEmailAddressMissing)
+            return
+        }
+        if !FirebaseAnalyticsHelper.isValidEmail(emailAddress) {
+            call.reject(errorInvalidEmailFormat)
+            return
+        }
+        implementation?.initiateOnDeviceConversionMeasurement(email: emailAddress)
+        call.resolve()
+    }
+
+    @objc func initiateOnDeviceConversionMeasurementWithPhoneNumber(_ call: CAPPluginCall) {
+        guard let phoneNumber = call.getString("phoneNumber") else {
+            call.reject(errorPhoneNumberMissing)
+            return
+        }
+        if !FirebaseAnalyticsHelper.isValidE164PhoneNumber(phoneNumber) {
+            call.reject(errorInvalidPhoneNumberFormat)
+            return
+        }
+        implementation?.initiateOnDeviceConversionMeasurement(phone: phoneNumber)
+        call.resolve()
+    }
+
+    @objc func initiateOnDeviceConversionMeasurementWithHashedEmailAddress(_ call: CAPPluginCall) {
+        guard let email = call.getString("emailAddressToHash") else {
+            call.reject(errorEmailAddressToHashMissing)
+            return
+        }
+        if !FirebaseAnalyticsHelper.isValidEmail(email) {
+            call.reject(errorInvalidEmailFormat)
+            return
+        }
+        let normalizedEmail = FirebaseAnalyticsHelper.normalizeEmail(email)
+        let hashedEmail = FirebaseAnalyticsHelper.sha256(normalizedEmail)
+        implementation?.initiateOnDeviceConversionMeasurement(hashedEmail: hashedEmail)
+        call.resolve()
+    }
+
+    @objc func initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(_ call: CAPPluginCall) {
+        guard let phone = call.getString("phoneNumberToHash") else {
+            call.reject(errorPhoneNumberToHashMissing)
+            return
+        }
+        if !FirebaseAnalyticsHelper.isValidE164PhoneNumber(phone) {
+            call.reject(errorInvalidPhoneNumberFormat)
+            return
+        }
+        let hashedPhone = FirebaseAnalyticsHelper.sha256(phone)
+        implementation?.initiateOnDeviceConversionMeasurement(hashedPhone: hashedPhone)
+        call.resolve()
+    }
 }
diff --git a/packages/analytics/ios/Podfile b/packages/analytics/ios/Podfile
index 55b470d9a..d3fa033e7 100644
--- a/packages/analytics/ios/Podfile
+++ b/packages/analytics/ios/Podfile
@@ -10,6 +10,7 @@ end
 target 'Plugin' do
   capacitor_pods
   pod 'FirebaseAnalytics', '11.7.0'
+  pod 'GoogleAppMeasurementOnDeviceConversion', '11.7.0'
 end
 
 target 'PluginTests' do
diff --git a/packages/analytics/src/definitions.ts b/packages/analytics/src/definitions.ts
index 9b17546aa..c277bba86 100644
--- a/packages/analytics/src/definitions.ts
+++ b/packages/analytics/src/definitions.ts
@@ -71,6 +71,46 @@ export interface FirebaseAnalyticsPlugin {
    * @since 0.1.0
    */
   resetAnalyticsData(): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with an email address.
+   *
+   * Only available for iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithEmailAddress(
+    options: InitiateOnDeviceConversionMeasurementWithEmailAddressOptions,
+  ): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with a phone number.
+   *
+   * Only available for iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithPhoneNumber(
+    options: InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions,
+  ): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with a hashed email address.
+   *
+   * Only available for iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithHashedEmailAddress(
+    options: InitiateOnDeviceConversionMeasurementWithHashedEmailAddressOptions,
+  ): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with a hashed phone number.
+   *
+   * Only available for iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(
+    options: InitiateOnDeviceConversionMeasurementWithHashedPhoneNumberOptions,
+  ): Promise<void>;
 }
 
 /**
@@ -240,3 +280,51 @@ export enum ConsentStatus {
    */
   Denied = 'DENIED',
 }
+
+/**
+ * @since 7.2.0
+ */
+export interface InitiateOnDeviceConversionMeasurementWithEmailAddressOptions {
+  /**
+   * The email address to initiate on-device conversion measurement with.
+   *
+   * @since 7.2.0
+   */
+  emailAddress: string;
+}
+
+/**
+ * @since 7.2.0
+ */
+export interface InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions {
+  /**
+   * The phone number to initiate on-device conversion measurement with.
+   *
+   * @since 7.2.0
+   */
+  phoneNumber: string;
+}
+
+/**
+ * @since 7.2.0
+ */
+export interface InitiateOnDeviceConversionMeasurementWithHashedEmailAddressOptions {
+  /**
+   * The email address to initiate on-device conversion measurement with.
+   *
+   * @since 7.2.0
+   */
+  emailAddressToHash: string;
+}
+
+/**
+ * @since 7.2.0
+ */
+export interface InitiateOnDeviceConversionMeasurementWithHashedPhoneNumberOptions {
+  /**
+   * The phone number to initiate on-device conversion measurement with.
+   *
+   * @since 7.2.0
+   */
+  phoneNumberToHash: string;
+}
diff --git a/packages/analytics/src/web.ts b/packages/analytics/src/web.ts
index 204af69f7..adbbfa453 100644
--- a/packages/analytics/src/web.ts
+++ b/packages/analytics/src/web.ts
@@ -12,6 +12,10 @@ import {
 import type {
   FirebaseAnalyticsPlugin,
   GetAppInstanceIdResult,
+  InitiateOnDeviceConversionMeasurementWithEmailAddressOptions,
+  InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions,
+  InitiateOnDeviceConversionMeasurementWithHashedEmailAddressOptions,
+  InitiateOnDeviceConversionMeasurementWithHashedPhoneNumberOptions,
   IsEnabledResult,
   LogEventOptions,
   SetConsentOptions,
@@ -106,4 +110,28 @@ export class FirebaseAnalyticsWeb
   public async resetAnalyticsData(): Promise<void> {
     throw this.unimplemented('Not implemented on web.');
   }
+
+  public async initiateOnDeviceConversionMeasurementWithEmailAddress(
+    _options: InitiateOnDeviceConversionMeasurementWithEmailAddressOptions,
+  ): Promise<void> {
+    throw this.unimplemented('Not implemented on web.');
+  }
+
+  public async initiateOnDeviceConversionMeasurementWithPhoneNumber(
+    _options: InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions,
+  ): Promise<void> {
+    throw this.unimplemented('Not implemented on web.');
+  }
+
+  public async initiateOnDeviceConversionMeasurementWithHashedEmailAddress(
+    _options: InitiateOnDeviceConversionMeasurementWithHashedEmailAddressOptions,
+  ): Promise<void> {
+    throw this.unimplemented('Not implemented on web.');
+  }
+
+  public async initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(
+    _options: InitiateOnDeviceConversionMeasurementWithHashedPhoneNumberOptions,
+  ): Promise<void> {
+    throw this.unimplemented('Not implemented on web.');
+  }
 }


Reviews:
user: login: robingenz
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-04-10T10:31:52Z
user: login: rencsikmarian
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-10T10:41:00Z
user: login: robingenz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-10T12:31:58Z
user: login: gcarpi
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-10T13:21:12Z
user: login: gcarpi
state: APPROVED
author_association: NONE
submitted_at: 2025-04-11T14:50:35Z
user: login: robingenz
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-04-13T12:33:00Z
user: login: robingenz
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-16T08:18:47Z
user: login: robingenz
body: Thank you!
state: APPROVED
author_association: MEMBER
submitted_at: 2025-04-16T08:19:42Z

Review comments:
path: packages/analytics/CapacitorFirebaseAnalytics.podspec
user: login: robingenz
body: I guess we also need to update the [`Package.swift`](https://github.com/rencsikmarian/capacitor-firebase/blob/feat/initiate-conversion-measurement/packages/analytics/Package.swift) file.
created_at: 2025-04-10T10:29:24Z
author_association: MEMBER
diff_hunk: @@ -27,4 +28,55 @@ public class FirebaseAnalyticsHelper {
             return nil
         }
     }
+
+    public static func normalizeEmail(_ email: String) -> String {
path: packages/analytics/ios/Plugin/FirebaseAnalyticsHelper.swift
user: login: robingenz
body: Did you get these methods from the Firebase documentation or how did you come up with it?
created_at: 2025-04-10T10:30:08Z
author_association: MEMBER
diff_hunk: @@ -71,6 +71,38 @@ export interface FirebaseAnalyticsPlugin {
    * @since 0.1.0
    */
   resetAnalyticsData(): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with an email address.
+   *
+   * Only available for Android and iOS.
+   *
+   * @since 6.0.0
path: packages/analytics/src/definitions.ts
user: login: robingenz
body: ```suggestion
   * @since 7.2.0
```

The next version will be 7.2.0.
created_at: 2025-04-10T10:31:15Z
author_association: MEMBER
diff_hunk: @@ -106,4 +110,21 @@ export class FirebaseAnalyticsWeb
   public async resetAnalyticsData(): Promise<void> {
     throw this.unimplemented('Not implemented on web.');
   }
+
+  public async initiateOnDeviceConversionMeasurementWithEmail(options: InitiateOnDeviceConversionMeasurementWithEmailOptions): Promise<void> {
+    throw this.unimplemented('Not implemented on web.' + JSON.stringify(options));
path: packages/analytics/src/web.ts
user: login: robingenz
body: ```suggestion
    throw this.unimplemented('Not implemented on web.');
```

Please just return the message without options.
created_at: 2025-04-10T10:31:44Z
author_association: MEMBER
diff_hunk: @@ -27,4 +28,55 @@ public class FirebaseAnalyticsHelper {
             return nil
         }
     }
+
+    public static func normalizeEmail(_ email: String) -> String {
path: packages/analytics/ios/Plugin/FirebaseAnalyticsHelper.swift
user: login: rencsikmarian
body: Yes, you can find how to normalize the email in the docs: https://firebase.google.com/docs/tutorials/ads-ios-on-device-measurement/step-3
created_at: 2025-04-10T10:41:00Z
author_association: CONTRIBUTOR
diff_hunk: @@ -27,4 +28,55 @@ public class FirebaseAnalyticsHelper {
             return nil
         }
     }
+
+    public static func normalizeEmail(_ email: String) -> String {
path: packages/analytics/ios/Plugin/FirebaseAnalyticsHelper.swift
user: login: robingenz
body: Please add a comment to the code so that we have a reference for this.
created_at: 2025-04-10T12:31:58Z
author_association: MEMBER
diff_hunk: @@ -314,6 +318,82 @@ Only available for Android and iOS.
 --------------------
 
 
+### initiateOnDeviceConversionMeasurementWithEmail(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithEmail(options: InitiateOnDeviceConversionMeasurementWithEmailOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with an email address.
+
+Only available for Android and iOS.
path: packages/analytics/README.md
user: login: gcarpi
body: This method is available only for iOS
created_at: 2025-04-10T13:07:42Z
author_association: NONE
diff_hunk: @@ -314,6 +318,82 @@ Only available for Android and iOS.
 --------------------
 
 
+### initiateOnDeviceConversionMeasurementWithEmail(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithEmail(options: InitiateOnDeviceConversionMeasurementWithEmailOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with an email address.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                    |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithemailoptions">InitiateOnDeviceConversionMeasurementWithEmailOptions</a></code> |
+
+**Since:** 6.0.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithPhoneNumber(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithPhoneNumber(options: InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a phone number.
+
+Only available for Android and iOS.
path: packages/analytics/README.md
user: login: gcarpi
body: This method is available only for iOS
created_at: 2025-04-10T13:08:05Z
author_association: NONE
diff_hunk: @@ -314,6 +318,82 @@ Only available for Android and iOS.
 --------------------
 
 
+### initiateOnDeviceConversionMeasurementWithEmail(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithEmail(options: InitiateOnDeviceConversionMeasurementWithEmailOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with an email address.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                    |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithemailoptions">InitiateOnDeviceConversionMeasurementWithEmailOptions</a></code> |
+
+**Since:** 6.0.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithPhoneNumber(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithPhoneNumber(options: InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a phone number.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                                |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithphonenumberoptions">InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions</a></code> |
+
+**Since:** 6.0.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithHashedEmail(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithHashedEmail(options: InitiateOnDeviceConversionMeasurementWithHashedEmailOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a hashed email address.
+
+Only available for Android and iOS.
path: packages/analytics/README.md
user: login: gcarpi
body: This method is available only for iOS
created_at: 2025-04-10T13:08:19Z
author_association: NONE
diff_hunk: @@ -314,6 +318,82 @@ Only available for Android and iOS.
 --------------------
 
 
+### initiateOnDeviceConversionMeasurementWithEmail(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithEmail(options: InitiateOnDeviceConversionMeasurementWithEmailOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with an email address.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                    |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithemailoptions">InitiateOnDeviceConversionMeasurementWithEmailOptions</a></code> |
+
+**Since:** 6.0.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithPhoneNumber(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithPhoneNumber(options: InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a phone number.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                                |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithphonenumberoptions">InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions</a></code> |
+
+**Since:** 6.0.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithHashedEmail(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithHashedEmail(options: InitiateOnDeviceConversionMeasurementWithHashedEmailOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a hashed email address.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                                |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithhashedemailoptions">InitiateOnDeviceConversionMeasurementWithHashedEmailOptions</a></code> |
+
+**Since:** 6.0.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(options: InitiateOnDeviceConversionMeasurementWithHashedPhoneNumberOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a hashed phone number.
+
+Only available for Android and iOS.
path: packages/analytics/README.md
user: login: gcarpi
body: This method is available only for iOS
created_at: 2025-04-10T13:08:25Z
author_association: NONE
diff_hunk: @@ -314,6 +318,82 @@ Only available for Android and iOS.
 --------------------
 
 
+### initiateOnDeviceConversionMeasurementWithEmail(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithEmail(options: InitiateOnDeviceConversionMeasurementWithEmailOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with an email address.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                    |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithemailoptions">InitiateOnDeviceConversionMeasurementWithEmailOptions</a></code> |
+
+**Since:** 6.0.0
path: packages/analytics/README.md
user: login: gcarpi
body: `**Since:** 7.2.0`
created_at: 2025-04-10T13:17:12Z
author_association: NONE
diff_hunk: @@ -314,6 +318,82 @@ Only available for Android and iOS.
 --------------------
 
 
+### initiateOnDeviceConversionMeasurementWithEmail(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithEmail(options: InitiateOnDeviceConversionMeasurementWithEmailOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with an email address.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                    |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithemailoptions">InitiateOnDeviceConversionMeasurementWithEmailOptions</a></code> |
+
+**Since:** 6.0.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithPhoneNumber(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithPhoneNumber(options: InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a phone number.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                                |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithphonenumberoptions">InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions</a></code> |
+
+**Since:** 6.0.0
path: packages/analytics/README.md
user: login: gcarpi
body: `**Since:** 7.2.0`
created_at: 2025-04-10T13:17:34Z
author_association: NONE
diff_hunk: @@ -314,6 +318,82 @@ Only available for Android and iOS.
 --------------------
 
 
+### initiateOnDeviceConversionMeasurementWithEmail(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithEmail(options: InitiateOnDeviceConversionMeasurementWithEmailOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with an email address.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                    |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithemailoptions">InitiateOnDeviceConversionMeasurementWithEmailOptions</a></code> |
+
+**Since:** 6.0.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithPhoneNumber(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithPhoneNumber(options: InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a phone number.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                                |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithphonenumberoptions">InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions</a></code> |
+
+**Since:** 6.0.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithHashedEmail(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithHashedEmail(options: InitiateOnDeviceConversionMeasurementWithHashedEmailOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a hashed email address.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                                |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithhashedemailoptions">InitiateOnDeviceConversionMeasurementWithHashedEmailOptions</a></code> |
+
+**Since:** 6.0.0
path: packages/analytics/README.md
user: login: gcarpi
body: `**Since:** 7.2.0`
created_at: 2025-04-10T13:17:47Z
author_association: NONE
diff_hunk: @@ -314,6 +318,82 @@ Only available for Android and iOS.
 --------------------
 
 
+### initiateOnDeviceConversionMeasurementWithEmail(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithEmail(options: InitiateOnDeviceConversionMeasurementWithEmailOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with an email address.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                    |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithemailoptions">InitiateOnDeviceConversionMeasurementWithEmailOptions</a></code> |
+
+**Since:** 6.0.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithPhoneNumber(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithPhoneNumber(options: InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a phone number.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                                |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithphonenumberoptions">InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions</a></code> |
+
+**Since:** 6.0.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithHashedEmail(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithHashedEmail(options: InitiateOnDeviceConversionMeasurementWithHashedEmailOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a hashed email address.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                                |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithhashedemailoptions">InitiateOnDeviceConversionMeasurementWithHashedEmailOptions</a></code> |
+
+**Since:** 6.0.0
+
+--------------------
+
+
+### initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(...)
+
+```typescript
+initiateOnDeviceConversionMeasurementWithHashedPhoneNumber(options: InitiateOnDeviceConversionMeasurementWithHashedPhoneNumberOptions) => Promise<void>
+```
+
+Initiates on-device conversion measurement with a hashed phone number.
+
+Only available for Android and iOS.
+
+| Param         | Type                                                                                                                                                            |
+| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| **`options`** | <code><a href="#initiateondeviceconversionmeasurementwithhashedphonenumberoptions">InitiateOnDeviceConversionMeasurementWithHashedPhoneNumberOptions</a></code> |
+
+**Since:** 6.0.0
path: packages/analytics/README.md
user: login: gcarpi
body: `**Since:** 7.2.0`
created_at: 2025-04-10T13:17:53Z
author_association: NONE
diff_hunk: @@ -384,6 +464,34 @@ Only available for Android and iOS.
 | **`enabled`** | <code>boolean</code> | 0.1.0 |
 
 
+#### InitiateOnDeviceConversionMeasurementWithEmailOptions
+
+| Prop        | Type                | Description                                                          | Since |
+| ----------- | ------------------- | -------------------------------------------------------------------- | ----- |
+| **`email`** | <code>string</code> | The email address to initiate on-device conversion measurement with. | 6.0.0 |
path: packages/analytics/README.md
user: login: gcarpi
body: The `since` should be `7.2.0`
created_at: 2025-04-10T13:18:34Z
author_association: NONE
diff_hunk: @@ -384,6 +464,34 @@ Only available for Android and iOS.
 | **`enabled`** | <code>boolean</code> | 0.1.0 |
 
 
+#### InitiateOnDeviceConversionMeasurementWithEmailOptions
+
+| Prop        | Type                | Description                                                          | Since |
+| ----------- | ------------------- | -------------------------------------------------------------------- | ----- |
+| **`email`** | <code>string</code> | The email address to initiate on-device conversion measurement with. | 6.0.0 |
+
+
+#### InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions
+
+| Prop        | Type                | Description                                                         | Since |
+| ----------- | ------------------- | ------------------------------------------------------------------- | ----- |
+| **`phone`** | <code>string</code> | The phone number to initiate on-device conversion measurement with. | 6.0.0 |
path: packages/analytics/README.md
user: login: gcarpi
body: The `since` should be `7.2.0`
created_at: 2025-04-10T13:18:39Z
author_association: NONE
diff_hunk: @@ -384,6 +464,34 @@ Only available for Android and iOS.
 | **`enabled`** | <code>boolean</code> | 0.1.0 |
 
 
+#### InitiateOnDeviceConversionMeasurementWithEmailOptions
+
+| Prop        | Type                | Description                                                          | Since |
+| ----------- | ------------------- | -------------------------------------------------------------------- | ----- |
+| **`email`** | <code>string</code> | The email address to initiate on-device conversion measurement with. | 6.0.0 |
+
+
+#### InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions
+
+| Prop        | Type                | Description                                                         | Since |
+| ----------- | ------------------- | ------------------------------------------------------------------- | ----- |
+| **`phone`** | <code>string</code> | The phone number to initiate on-device conversion measurement with. | 6.0.0 |
+
+
+#### InitiateOnDeviceConversionMeasurementWithHashedEmailOptions
+
+| Prop        | Type                | Description                                                          | Since |
+| ----------- | ------------------- | -------------------------------------------------------------------- | ----- |
+| **`email`** | <code>string</code> | The email address to initiate on-device conversion measurement with. | 6.0.0 |
path: packages/analytics/README.md
user: login: gcarpi
body: The `since` should be `7.2.0`
created_at: 2025-04-10T13:18:43Z
author_association: NONE
diff_hunk: @@ -384,6 +464,34 @@ Only available for Android and iOS.
 | **`enabled`** | <code>boolean</code> | 0.1.0 |
 
 
+#### InitiateOnDeviceConversionMeasurementWithEmailOptions
+
+| Prop        | Type                | Description                                                          | Since |
+| ----------- | ------------------- | -------------------------------------------------------------------- | ----- |
+| **`email`** | <code>string</code> | The email address to initiate on-device conversion measurement with. | 6.0.0 |
+
+
+#### InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions
+
+| Prop        | Type                | Description                                                         | Since |
+| ----------- | ------------------- | ------------------------------------------------------------------- | ----- |
+| **`phone`** | <code>string</code> | The phone number to initiate on-device conversion measurement with. | 6.0.0 |
+
+
+#### InitiateOnDeviceConversionMeasurementWithHashedEmailOptions
+
+| Prop        | Type                | Description                                                          | Since |
+| ----------- | ------------------- | -------------------------------------------------------------------- | ----- |
+| **`email`** | <code>string</code> | The email address to initiate on-device conversion measurement with. | 6.0.0 |
+
+
+#### InitiateOnDeviceConversionMeasurementWithHashedPhoneNumberOptions
+
+| Prop        | Type                | Description                                                         | Since |
+| ----------- | ------------------- | ------------------------------------------------------------------- | ----- |
+| **`phone`** | <code>string</code> | The phone number to initiate on-device conversion measurement with. | 6.0.0 |
path: packages/analytics/README.md
user: login: gcarpi
body: The `since` should be `7.2.0`
created_at: 2025-04-10T13:18:47Z
author_association: NONE
diff_hunk: @@ -71,6 +71,46 @@ export interface FirebaseAnalyticsPlugin {
    * @since 0.1.0
    */
   resetAnalyticsData(): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with an email address.
+   *
+   * Only available for Android and iOS.
path: packages/analytics/src/definitions.ts
user: login: gcarpi
body: This method is available only for iOS
created_at: 2025-04-10T13:20:04Z
author_association: NONE
diff_hunk: @@ -71,6 +71,46 @@ export interface FirebaseAnalyticsPlugin {
    * @since 0.1.0
    */
   resetAnalyticsData(): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with an email address.
+   *
+   * Only available for Android and iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithEmail(
+    options: InitiateOnDeviceConversionMeasurementWithEmailOptions,
+  ): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with a phone number.
+   *
+   * Only available for Android and iOS.
path: packages/analytics/src/definitions.ts
user: login: gcarpi
body: This method is available only for iOS
created_at: 2025-04-10T13:20:09Z
author_association: NONE
diff_hunk: @@ -71,6 +71,46 @@ export interface FirebaseAnalyticsPlugin {
    * @since 0.1.0
    */
   resetAnalyticsData(): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with an email address.
+   *
+   * Only available for Android and iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithEmail(
+    options: InitiateOnDeviceConversionMeasurementWithEmailOptions,
+  ): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with a phone number.
+   *
+   * Only available for Android and iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithPhoneNumber(
+    options: InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions,
+  ): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with a hashed email address.
+   *
+   * Only available for Android and iOS.
path: packages/analytics/src/definitions.ts
user: login: gcarpi
body: This method is available only for iOS
created_at: 2025-04-10T13:20:13Z
author_association: NONE
diff_hunk: @@ -71,6 +71,46 @@ export interface FirebaseAnalyticsPlugin {
    * @since 0.1.0
    */
   resetAnalyticsData(): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with an email address.
+   *
+   * Only available for Android and iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithEmail(
+    options: InitiateOnDeviceConversionMeasurementWithEmailOptions,
+  ): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with a phone number.
+   *
+   * Only available for Android and iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithPhoneNumber(
+    options: InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions,
+  ): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with a hashed email address.
+   *
+   * Only available for Android and iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithHashedEmail(
+    options: InitiateOnDeviceConversionMeasurementWithHashedEmailOptions,
+  ): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with a hashed phone number.
+   *
+   * Only available for Android and iOS.
path: packages/analytics/src/definitions.ts
user: login: gcarpi
body: This method is available only for iOS
created_at: 2025-04-10T13:20:18Z
author_association: NONE
diff_hunk: @@ -71,6 +71,46 @@ export interface FirebaseAnalyticsPlugin {
    * @since 0.1.0
    */
   resetAnalyticsData(): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with an email address.
+   *
+   * Only available for iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithEmail(
+    options: InitiateOnDeviceConversionMeasurementWithEmailOptions,
+  ): Promise<void>;
path: packages/analytics/src/definitions.ts
user: login: robingenz
body: ```suggestion
  initiateOnDeviceConversionMeasurementWithEmailAddress(
    options: InitiateOnDeviceConversionMeasurementWithEmailAddressOptions,
  ): Promise<void>;
```
created_at: 2025-04-13T12:28:13Z
author_association: MEMBER
diff_hunk: @@ -71,6 +71,46 @@ export interface FirebaseAnalyticsPlugin {
    * @since 0.1.0
    */
   resetAnalyticsData(): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with an email address.
+   *
+   * Only available for iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithEmail(
+    options: InitiateOnDeviceConversionMeasurementWithEmailOptions,
+  ): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with a phone number.
+   *
+   * Only available for iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithPhoneNumber(
+    options: InitiateOnDeviceConversionMeasurementWithPhoneNumberOptions,
+  ): Promise<void>;
+  /**
+   * Initiates on-device conversion measurement with a hashed email address.
+   *
+   * Only available for iOS.
+   *
+   * @since 7.2.0
+   */
+  initiateOnDeviceConversionMeasurementWithHashedEmail(
+    options: InitiateOnDeviceConversionMeasurementWithHashedEmailOptions,
path: packages/analytics/src/definitions.ts
user: login: robingenz
body: ```suggestion
  initiateOnDeviceConversionMeasurementWithHashedEmailAddress(
    options: InitiateOnDeviceConversionMeasurementWithHashedEmailAddressOptions,
```
created_at: 2025-04-13T12:31:55Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,5 @@
+---
+'@capacitor-firebase/analytics': major
+---
+
+feat(analytics): add initiateOnDeviceConversionMeasurement for iOS
path: .changeset/witty-balloons-punch.md
user: login: robingenz
body: ```suggestion
---
'@capacitor-firebase/analytics': minor
---

feat(analytics): support `initiateOnDeviceConversionMeasurement` on iOS
```
created_at: 2025-04-16T08:18:47Z
author_association: MEMBER

PR comments:
user: login: gcarpi
created_at: 2025-04-10T18:26:55Z
body: Hi @rencsikmarian

I installed the PR to test, I'm sending the email and phone number to the `initiateOnDeviceConversionMeasurementWithEmail` and `initiateOnDeviceConversionMeasurementWithPhoneNumber`, however, I'm receiving a response in Xcode saying that the email and phone number are not being passed:

![Screenshot 2025-04-10 at 15 23 17](https://github.com/user-attachments/assets/2942c250-ebd1-4f11-b00d-4f71e57a726b)


My code:
```js
const { email, phone } = loggedUser

console.log(
  '---------> initiateOnDeviceConversionMeasurementWithEmail <--------',
  { email, phone }
)

FirebaseAnalytics.initiateOnDeviceConversionMeasurementWithEmail({ email })

FirebaseAnalytics.initiateOnDeviceConversionMeasurementWithPhoneNumber({ phone })
```

Am I doing something wrong?
author_association: NONE
user: login: pkg-pr-new[bot]
created_at: 2025-04-10T18:27:25Z
body: 
[Open in StackBlitz](https://pkg.pr.new/template/44887638-b629-4ebe-8138-088ad1afc170)


<details><summary><b>@capacitor-firebase/analytics</b></summary><p>

```
npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/analytics@852
```

</p></details>
      
    

<details><summary><b>@capacitor-firebase/app</b></summary><p>

```
npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/app@852
```

</p></details>
      
    

<details><summary><b>@capacitor-firebase/app-check</b></summary><p>

```
npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/app-check@852
```

</p></details>
      
    

<details><summary><b>@capacitor-firebase/authentication</b></summary><p>

```
npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/authentication@852
```

</p></details>
      
    

<details><summary><b>@capacitor-firebase/crashlytics</b></summary><p>

```
npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/crashlytics@852
```

</p></details>
      
    

<details><summary><b>@capacitor-firebase/firestore</b></summary><p>

```
npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/firestore@852
```

</p></details>
      
    

<details><summary><b>@capacitor-firebase/functions</b></summary><p>

```
npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/functions@852
```

</p></details>
      
    

<details><summary><b>@capacitor-firebase/messaging</b></summary><p>

```
npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/messaging@852
```

</p></details>
      
    

<details><summary><b>@capacitor-firebase/performance</b></summary><p>

```
npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/performance@852
```

</p></details>
      
    

<details><summary><b>@capacitor-firebase/remote-config</b></summary><p>

```
npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/remote-config@852
```

</p></details>
      
    

<details><summary><b>@capacitor-firebase/storage</b></summary><p>

```
npm i https://pkg.pr.new/capawesome-team/capacitor-firebase/@capacitor-firebase/storage@852
```

</p></details>
      
    

_commit: <a href="https://github.com/capawesome-team/capacitor-firebase/runs/40638293214"><code>e549e7c</code></a>_

author_association: NONE
user: login: rencsikmarian
created_at: 2025-04-10T18:42:17Z
body: Hi @gcarpi 
Please use the methods like this:

`FirebaseAnalytics.initiateOnDeviceConversionMeasurementWithEmail({ "emailAddress": email })`
`FirebaseAnalytics.initiateOnDeviceConversionMeasurementWithPhoneNumber({ "phoneNumber": phone })`
`FirebaseAnalytics.initiateOnDeviceConversionMeasurementWithHashedEmail({ "emailAddressToHash": email })`
`FirebaseAnalytics.initiateOnDeviceConversionMeasurementWithHashedPhoneNumber({ "phoneNumberToHash": phone })`
author_association: CONTRIBUTOR
user: login: gcarpi
created_at: 2025-04-10T19:24:53Z
body: > Hi @gcarpi Please use the methods like this:
> 
> `FirebaseAnalytics.initiateOnDeviceConversionMeasurementWithEmail({ "emailAddress": email })` `FirebaseAnalytics.initiateOnDeviceConversionMeasurementWithPhoneNumber({ "phoneNumber": phone })` `FirebaseAnalytics.initiateOnDeviceConversionMeasurementWithHashedEmail({ "emailAddressToHash": email })` `FirebaseAnalytics.initiateOnDeviceConversionMeasurementWithHashedPhoneNumber({ "phoneNumberToHash": phone })`

This works! Thank you very much for this PR! It was a great help.
author_association: NONE
user: login: robingenz
created_at: 2025-04-13T12:33:36Z
body: @rencsikmarian Please also generate a changeset by running `npm run changeset`.
author_association: MEMBER
user: login: robingenz
created_at: 2025-04-15T11:28:26Z
body: @rencsikmarian If you implement the requested changes this week, we can include this PR in the next release.
author_association: MEMBER