[Limited ads](https://support.google.com/admanager/answer/9882911) 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 version 1.109.0 introduces
the `forceLimitedAds` property and removed the
`allowStorage` property. This property is in the
[`ConsentSettings`](https://developers.google.com/ad-manager/pal/html5/reference/class/goog.pal.ConsentSettings)

class.

Starting in version 1.109.0, PAL reads Transparency and
Consent Framework (TCF) data from the device to determine user
consent for local storage. Previously, your app was responsible for determining
storage consent. 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](https://support.google.com/admanager/answer/9805023).
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)](https://support.google.com/admanager/answer/10678356#ltd&zippy=%2Cltd-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 `allowStorage` property defaulted to a `false` value, which
*enabled* limited ads. The `forceLimitedAds` property defaults to a `false`
value, which *doesn't enable* limited ads.

## Match Google Ad Manager global settings

If you update the Ad Manager settings **Programmatic limited ads** or
**First party
cookies
for ads on
web**,
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`](https://developers.google.com/ad-manager/pal/html5/reference/class/goog.pal.GoogleAdManagerSettings#goog.pal.GoogleAdManagerSettings.disableLimitedAdsStorage) - disables invalid traffic detection-only cookies 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`](https://developers.google.com/ad-manager/pal/html5/reference/class/goog.pal.GoogleAdManagerSettings#goog.pal.GoogleAdManagerSettings.disableFirstPartyIdentifiers) - disables first-party identifiers used for ad selection. If you updated the **First party
  cookies
  for ads on
  web** 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 cookies 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:

    const consentSettings = new goog.pal.ConsentSettings();
    consentSettings.allowStorage = true;
    // During the PAL Phase 1 release, best practice is to always set the
    // `allowStorage` property to a `true` value 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.

    const adManagerSettings = new goog.pal.GoogleAdManagerSettings();
    // Add this line if the "Programmatic limited ads" toggle is turned off in
    // Ad Manager.
    adManagerSettings.disableLimitedAdsStorage = true;
    // Add this line if the "First party cookies for ads on web" toggle
    // is turned off in Ad Manager.
    adManagerSettings.disableFirstPartyIdentifiers = true;

    const nonceLoader = new goog.pal.NonceLoader(consentSettings, adManagerSettings);