Limited ads and first party identifier settings

  • 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 disableLimitedAdsStorage API disables invalid traffic detection identifiers and local storage for limited ads, corresponding to the Programmatic limited ads setting.

  • The disableFirstPartyIdentifiers API 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.

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.

The following example sets these parameters:

ConsentSettings consentSettings = ConsentSettings.builder()
            .allowStorage(isConsentToStorage)
            .build();

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);