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
- 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
- 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.
The following example sets these parameters:
const consentSettings = new goog.pal.ConsentSettings();
consentSettings.allowStorage = getConsentToStorage();
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.
adManagerSettings.disableFirstPartyIdentifiers = true;
const nonceLoader = new goog.pal.NonceLoader(consentSettings, adManagerSettings);