Tutorial: Use first-party data to measure Google Ads conversions from your iOS app campaigns
Stay organized with collections
Save and categorize content based on your preferences.
Solution tutorial
Google's on-device conversion measurement improves the number of observable
conversions from your iOS app campaigns while keeping users' personal data
private. In this tutorial, you'll learn how the solution works and follow along
with the steps needed to implement it.
How does this work?
On-device conversion measurement helps measure app installs and in-app actions
from your iOS app campaigns. The Google Analytics for Firebase SDK
performs on-device attribution using a user's identity provided by your app's
sign-in experience. The user's identity is hidden through our on-device
conversion approach so that no personally identifiable information ever leaves
the user's device.
To use this technology, you need a consented, user-provided email address or
phone number. Through the initiateOnDeviceConversionMeasurement()
API, the
email address or phone number is used by the Google Analytics for
Firebase SDK for attribution such that this personal data is never sent off the
device in a way that can identify the user or device. The feature works on apps
running iOS 12+.
You can use Firebase Authentication to allow users to sign in to your app using
one or more sign-in methods. Once integrated with Firebase Authentication, you can get
the signed-in user's email or phone number to send to the Google Analytics
for Firebase SDK.
Products and features used in this tutorial
Google Ads
Google Ads lets you drive installs, gain
deep insights into ad conversions, and run targeted ad campaigns using
Google Analytics audiences to engage your user base.
Google Analytics
Google Analytics gives you insight into
user engagement, retention, and monetization metrics like total revenue,
AdMob revenue, purchase revenue, and much more. It also allows you to
create user audiences and segments.
|
Firebase Authentication
Firebase Authentication provides backend services,
easy-to-use SDKs, and ready-made UI libraries to authenticate users to your
app. It supports authentication using passwords, phone numbers, popular
federated identity providers (like Google, Facebook, and Twitter), and more.
|
Tutorial overview
Go
directly to the step-by-step tutorial
Implement
a sign-in experience
Use Firebase Authentication to build a sign-in experience.
Or, combine Firebase Authentication with your custom sign-in experience.
In your sign-in interface, get the user's email address or phone number.
Integrate
Google Analytics into your app
Follow integration steps for Cocoapods, Swift Package Manager or manual
installation.
Optionally, enable debug mode in Xcode.
Initiate
on-device conversion measurement
Call the on-device measurement API with the email or phone number you
gathered.
Verify API function with debug logs.
Troubleshoot and
handle common issues
If needed, troubleshoot with the help of support resources for
Firebase Authentication and Google Analytics.
Handle some commonly-encountered issues.
What you'll need
Step 1: Implement a sign-in experiencearrow_forward_ios
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-15 UTC.
[null,null,["Last updated 2025-08-15 UTC."],[],[],null,["**Solution tutorial**\n\nGoogle's on-device conversion measurement improves the number of observable\nconversions from your iOS app campaigns while keeping users' personal data\nprivate. In this tutorial, you'll learn how the solution works and follow along\nwith the steps needed to implement it.\n\nHow does this work?\n\nOn-device conversion measurement helps measure app installs and in-app actions\nfrom your iOS app campaigns. The Google Analytics for Firebase SDK\nperforms on-device attribution using a user's identity provided by your app's\nsign-in experience. The user's identity is hidden through our on-device\nconversion approach so that no personally identifiable information ever leaves\nthe user's device.\n\nTo use this technology, you need a consented, user-provided email address or\nphone number. Through the `initiateOnDeviceConversionMeasurement()` API, the\nemail address or phone number is used by the Google Analytics for\nFirebase SDK for attribution such that this personal data is never sent off the\ndevice in a way that can identify the user or device. The feature works on apps\nrunning iOS 12+.\n\nYou can use Firebase Authentication to allow users to sign in to your app using\none or more sign-in methods. Once integrated with Firebase Authentication, you can get\nthe signed-in user's email or phone number to send to the Google Analytics\nfor Firebase SDK.\n\nProducts and features used in this tutorial\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Google Ads \u003e [Google Ads](/docs/ads) lets you drive installs, gain deep insights into ad conversions, and run targeted ad campaigns using Google Analytics audiences to engage your user base. Google Analytics \u003e [Google Analytics](/docs/analytics) gives you insight into user engagement, retention, and monetization metrics like total revenue, AdMob revenue, purchase revenue, and much more. It also allows you to create user audiences and segments. | Firebase Authentication \u003e [Firebase Authentication](/docs/auth) provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. It supports authentication using passwords, phone numbers, popular federated identity providers (like Google, Facebook, and Twitter), and more. |\n\n\u003cbr /\u003e\n\nTutorial overview\n\n[Go\ndirectly to the step-by-step tutorial](/docs/tutorials/ads-ios-on-device-measurement/step-1)\n\n1. [**Implement\n a sign-in experience**](/docs/tutorials/ads-ios-on-device-measurement/step-1)\n\n 1. Use Firebase Authentication to build a sign-in experience.\n\n 2. Or, combine Firebase Authentication with your custom sign-in experience.\n\n 3. In your sign-in interface, get the user's email address or phone number.\n\n2. [**Integrate\n Google Analytics into your app**](/docs/tutorials/ads-ios-on-device-measurement/step-2)\n\n 1. Follow integration steps for Cocoapods, Swift Package Manager or manual\n installation.\n\n 2. Optionally, enable debug mode in Xcode.\n\n3. [**Initiate\n on-device conversion measurement**](/docs/tutorials/ads-ios-on-device-measurement/step-3)\n\n 1. Call the on-device measurement API with the email or phone number you\n gathered.\n\n 2. Verify API function with debug logs.\n\n4. [**Troubleshoot and\n handle common issues**](/docs/tutorials/ads-ios-on-device-measurement/step-4)\n\n 1. If needed, troubleshoot with the help of support resources for\n Firebase Authentication and Google Analytics.\n\n 2. Handle some commonly-encountered issues.\n\nWhat you'll need\n\n- Your own app that can run on iOS 12 or higher\n\n- Your app registered as a Firebase App that's linked to Google Analytics\n and Ads\n\n- Your preferred IDE\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\u003cbr /\u003e\n\n[**Step 1** : Implement a sign-in experiencearrow_forward_ios](/docs/tutorials/ads-ios-on-device-measurement/step-1)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n*** ** * ** ***"]]