การตั้งค่าโฆษณาแบบจํากัดและตัวระบุของบุคคลที่หนึ่ง
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หากคุณอัปเดตการตั้งค่า โฆษณาแบบจำกัดแบบเป็นโปรแกรมหรือคุกกี้ของบุคคลที่หนึ่งสำหรับโฆษณาบนเว็บใน Ad Manager ให้ใช้ API ใหม่เหล่านี้เพื่อให้ตรงกับการตั้งค่าใน Ad Manager หากคุณไม่ได้ใช้ API ทาง PAL อาจรวมตัวระบุไว้ใน Nonce ที่ใช้ในการส่งคําขอโฆษณาไปยังเซิร์ฟเวอร์ อย่างไรก็ตาม Ad Manager อาจทิ้งสัญญาณตามการตั้งค่าใน Ad Manager
API ดังกล่าวมีดังนี้
disableLimitedAdsStorage
-
ปิดใช้คุกกี้ที่มีไว้เพื่อตรวจจับการเข้าชมที่ไม่ถูกต้องเท่านั้น และการใช้พื้นที่เก็บข้อมูลในเครื่องสําหรับโฆษณาแบบจํากัด หากคุณอัปเดตการตั้งค่าโฆษณาแบบจำกัดแบบเป็นโปรแกรมใน Ad Manager ภายในผู้ดูแลระบบ > การตั้งค่าส่วนกลาง ให้ใช้ API นี้เพื่อปิดใช้พื้นที่เก็บข้อมูลในเครื่องสําหรับโฆษณาแบบจํากัดใน PAL โปรดทราบว่าการตั้งค่านี้ไม่มีผลกับโฆษณาที่ไม่มีการจำกัด
disableFirstPartyIdentifiers
-
ปิดใช้ตัวระบุของบุคคลที่หนึ่งที่ใช้สําหรับการเลือกโฆษณา หากคุณอัปเดตการตั้งค่าคุกกี้ของบุคคลที่หนึ่งสำหรับโฆษณาบนเว็บใน Ad Manager ภายในการตั้งค่าผู้ดูแลระบบ > การตั้งค่าส่วนกลาง ให้ใช้ API นี้เพื่อปิดใช้ตัวระบุดังกล่าวใน PAL โปรดทราบว่าการตั้งค่านี้ไม่มีผลกับการใช้คุกกี้และพื้นที่เก็บข้อมูลในเครื่องเพื่อตรวจจับการเข้าชมที่ไม่ถูกต้อง
ตัวอย่างต่อไปนี้จะตั้งค่าพารามิเตอร์เหล่านี้
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);"]]