IDFA support (iOS only)

  • The User Messaging Platform (UMP) SDK helps you present an IDFA message to users before requesting their App Tracking Transparency (ATT) consent.

  • To show a custom alert message, you need to add the NSUserTrackingUsageDescription key and a custom message to your Info.plist file.

  • The AppTrackingTransparency framework must be linked to your app.

  • For testing purposes, the ATT alert only appears once unless you uninstall and reinstall your app.

  • You can continue to request ads using the Google Mobile Ads SDK even if a user denies ATT, and the SDK will not send IDFA in the ad request.

Select platform: iOS Flutter

The User Messaging Platform (UMP) SDK lets you present an IDFA message to your users before requesting their consent for App Tracking Transparency (ATT). The IDFA message shows your users how your app uses the identifier.

This guide covers using the UMP SDK to present an IDFA message.

Prerequisites

Before you begin, make sure you've done the following:

Update Info.plist

To show a custom alert message, do the following:

  1. Open the Info.plist file.
  2. Add the NSUserTrackingUsageDescription key with a custom message that describes the usage:
<key>NSUserTrackingUsageDescription</key>
<string>This identifier will be used to deliver personalized ads to you.</string>

The usage description appears as part of the IDFA ATT alert when you present the consent form:

Then, link the AppTrackingTransparency framework:

Your app then shows an IDFA message before the ATT alert.

Testing

While testing, remember that the ATT alert only appears a single time since requestTrackingAuthorization is a one-time request. The UMP SDK only has a form available to load if the authorization status is ATTrackingManagerAuthorizationStatusNotDetermined.

To make the alert appear a second time, you must uninstall and reinstall your app on your test device.

Request ads with or without IDFA

If a user denies ATT, continue to request ads using your ad format's APIs. The Google Mobile Ads SDK doesn't send IDFA in the ad request. For more details see, Select an ad format.