制限付き広告とファーストパーティ識別子の設定
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
アド マネージャーの設定の [プログラマティック限定広告] または [ウェブ広告のファーストパーティ Cookie] を更新する場合は、これらの新しい API を使用して、アド マネージャーの設定と一致させます。API を使用しない場合、PAL は、サーバーへの広告リクエストで使用されるノンスに ID を含めることがあります。ただし、アド マネージャーの設定に基づいて、アド マネージャーがシグナルを破棄する場合があります。
API は次のとおりです。
disableLimitedAdsStorage
- 無効なトラフィック検出専用の Cookie と制限付き広告のローカル ストレージの使用を無効にします。アド マネージャーの [管理] > [全般設定] で [プログラマティック制限付き広告] の設定を更新した場合は、この API を使用して、PAL で制限付き広告のローカル ストレージの使用を無効にします。この設定は、制限なしの広告には適用されません。
disableFirstPartyIdentifiers
- 広告選択に使用されるファーストパーティ識別子を無効にします。アド マネージャーの [管理] > [全般設定] で [ウェブ広告のファーストパーティ Cookie] の設定を更新した場合は、この API を使用して PAL でそのような識別子を無効にします。この設定は、無効なトラフィック検出のための Cookie とローカル ストレージの使用には適用されません。
次の例では、これらのパラメータを設定しています。
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 in Ad Manager.
adManagerSettings.disableFirstPartyIdentifiers = true;
const nonceLoader = new goog.pal.NonceLoader(consentSettings, adManagerSettings);
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-21 UTC。
[null,null,["最終更新日 2025-08-21 UTC。"],[],[],null,["# Limited ads and first party identifier settings\n\nIf you update the Ad Manager settings **Programmatic limited ads** or\n**First party\ncookies\nfor ads on\nweb**,\nuse these new APIs to match the settings in Ad Manager. If you don't use the\nAPIs PAL might include the identifiers in the nonce that is used in the ad\nrequest to the server. However, Ad Manager might drop the signals based on the\nsettings in Ad Manager.\n\nThe APIs are as follows:\n\n- [`disableLimitedAdsStorage`](/ad-manager/pal/html5/reference/js/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 \\\u003e 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.\n- [`disableFirstPartyIdentifiers`](/ad-manager/pal/html5/reference/js/GoogleAdManagerSettings#disableFirstPartyIdentifiers) - disables first-party identifiers used for ad selection. If you updated the **First party\n cookies\n for ads on\n web** setting in Ad Manager within **Admin \\\u003e 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.\n\nThe following example sets these parameters: \n\n const consentSettings = new goog.pal.ConsentSettings();\n consentSettings.allowStorage = getConsentToStorage();\n\n const adManagerSettings = new goog.pal.GoogleAdManagerSettings();\n // Add this line if the \"Programmatic limited ads\" toggle is turned off in\n // Ad Manager.\n adManagerSettings.disableLimitedAdsStorage = true;\n // Add this line if the \"First party cookies for ads on web\" toggle\n // is turned off in Ad Manager.\n adManagerSettings.disableFirstPartyIdentifiers = true;\n\n const nonceLoader = new goog.pal.NonceLoader(consentSettings, adManagerSettings);"]]