Limited ads and first party cookie settings
Stay organized with collections
Save and categorize content based on your preferences.
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);
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-21 UTC."],[[["Use the provided APIs to align your Ad Manager settings with PAL (Programmatic Limited Ads) and ensure accurate ad delivery by preventing potential signal drops due to mismatched settings."],["The `disableLimitedAdsStorage` API disables storage usage for limited ads in PAL, mirroring the \"Programmatic limited ads\" setting in Ad Manager, and does not impact non-limited ads."],["The `disableFirstPartyIdentifiers` API disables first-party identifiers used for ad selection in PAL, corresponding to the \"First party cookies for ads on web\" setting in Ad Manager, while excluding invalid traffic detection."],["By implementing these APIs through the provided code example within your `GoogleAdManagerSettings`, you ensure consistent ad delivery and respect user consent preferences aligned with Ad Manager."]]],[]]