Page Summary
-
New APIs should be used to match Ad Manager settings for Programmatic limited ads or First party identifiers for ads on apps.
-
Failure to use these APIs might lead to identifiers being included in the nonce, but Ad Manager could drop the signals based on settings.
-
The
disableLimitedAdsStorageAPI disables invalid traffic detection identifiers and local storage for limited ads, corresponding to the Programmatic limited ads setting. -
The
disableFirstPartyIdentifiersAPI disables first-party identifiers for ad selection, corresponding to the First party identifiers for ads on apps setting. -
Example code demonstrates how to use these APIs within
GoogleAdManagerSettings.
Limited ads lets apps serve ads when your users don't consent to share personal data. Limited ads mode stops the collection, sharing, and use of personal data for ad selection. If your users choose to not share personal data, this feature lets ads continue serving.
This guide covers using limited ads settings in your app, and matching app behavior with your Google Ad Manager network's global settings.
Configure client limited ads settings
PAL is updating how it handles settings to refine control over user
privacy and data usage. PAL version 23.0.0 introduces
the forceLimitedAds property and
removes the existing
allowStorage property. These properties are in the
ConsentSettings
class.
Starting in version 23.0.0, PAL reads Transparency and
Consent Framework (TCF) data from the device to determine user
consent for local storage. This change to reading TCF data makes the existing
allowStorage property redundant. Your app still must pass the gdpr= and
gdpr_consent= parameters in the ad tag URL.
If the automatic TCF-based determination is insufficient, directly set the
forceLimitedAds property in your app. For details, see
Publisher integration with the IAB Europe TCF.
Setting the forceLimitedAds property to a true value prevents PAL from
storing or sending user identifiers in the nonce sent to the server.
Setting the forceLimitedAds property to a true value is the same as
adding the ltd=1 parameter to the ad request URL in IMA (Interactive Media
Ads) SDKs. For details about limited ads, see
ltd (Limited ads).
When you set the forceLimitedAds property to a true value, PAL includes
ltd=1 parameter in the nonce.
To keep the current behavior in your app, you might need to update your
implementation, even if you did not set the allowStorage property before.
The existing allowStorage property defaults to a false value, which
enables limited ads. The forceLimitedAds property defaults to a false
value, which doesn't enable limited ads.
Update PAL implementation for TCF-based determination
PAL Android requires action when updating to version
23.0.0, which lets PAL to read TCF data from the
device to determine user consent for local storage. This version also adds the
forceLimitedAds property and removes the allowStorage property. Only
update your app to use the forceLimitedAds property if TCF-based
activation of limited ads doesn't meet your app's requirements. To learn more
about TCF-based determination, see
Publisher integration with the IAB Europe TCF.
Match Google Ad Manager global settings
If you update the Ad Manager settings Programmatic limited ads or First party identifiers for ads on apps, use these new APIs to match the settings in Ad Manager. If you don't use the APIs PAL might include the identifiers in the nonce that is used in the ad request to the server. However, Ad Manager might drop the signals based on the settings in Ad Manager.
The APIs are as follows:
disableLimitedAdsStorage- disables invalid traffic detection-only identifiers and use of local storage for limited ads. If you updated the Programmatic limited ads setting in Ad Manager within Admin > Global settings, use this API to disable usage of local storage for limited ads in PAL. Note that this setting does not apply to non-limited ads.disableFirstPartyIdentifiers- disables first-party identifiers used for ad selection. If you updated the First party identifiers for ads on apps setting in Ad Manager within Admin > Global settings, use this API to disable such identifiers in PAL. Note that this setting does not apply to the use of identifiers and local storage for invalid traffic detection.
Handle user consent in your app
The following example handles user privacy and data usage in a PAL implementation:
ConsentSettings consentSettings = ConsentSettings.builder()
.directedForChildOrUnknownAge(false)
.build();
// PAL Android version 23.0.0 introduces
// `ConsentSettings.forceLimitedAds` and removes `ConsentSettings.allowStorage`.
// Best practice is to not set `forceLimitedAds` to allow PAL to automatically
// determine whether limited ads applies based on the TCF data.
// To enable limited ads regardless of the TCF determination, set the
// `forceLimitedAds` property to a `true` value.
GoogleAdManagerSettings adManagerSettings = GoogleAdManagerSettings.builder()
// Add this line if the "Programmatic limited ads" toggle is turned
// off in Ad Manager.
.disableLimitedAdsStorage(true)
// Add this line if the
// "First party identifiers for ads on app" toggle is turned
// off in Ad Manager.
.disableFirstPartyIdentifiers(true)
.build();
nonceLoader = new NonceLoader(this, consentSettings, adManagerSettings);