การตั้งค่าโฆษณาแบบจํากัดและตัวระบุของบุคคลที่หนึ่ง
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หากคุณอัปเดตการตั้งค่า Ad Manager โฆษณาแบบจำกัดแบบเป็นโปรแกรมหรือตัวระบุของบุคคลที่หนึ่งสำหรับโฆษณาในแอป ให้ใช้ API ใหม่เหล่านี้เพื่อให้ตรงกับการตั้งค่าใน Ad Manager หากคุณไม่ได้ใช้ API ทาง PAL อาจรวมตัวระบุไว้ใน Nonce ที่ใช้ในการส่งคําขอโฆษณาไปยังเซิร์ฟเวอร์ อย่างไรก็ตาม Ad Manager อาจทิ้งสัญญาณตามการตั้งค่าใน Ad Manager
API ดังกล่าวมีดังนี้
disableLimitedAdsStorage
-
ปิดใช้ตัวระบุที่มีไว้เพื่อตรวจจับการเข้าชมที่ไม่ถูกต้องเท่านั้น และการใช้พื้นที่เก็บข้อมูลในเครื่องสําหรับโฆษณาแบบจํากัด หากคุณอัปเดตการตั้งค่าโฆษณาแบบจำกัดแบบเป็นโปรแกรมใน Ad Manager ภายในผู้ดูแลระบบ > การตั้งค่าส่วนกลาง ให้ใช้ API นี้เพื่อปิดใช้พื้นที่เก็บข้อมูลในเครื่องสําหรับโฆษณาแบบจํากัดใน PAL โปรดทราบว่าการตั้งค่านี้ไม่มีผลกับโฆษณาที่ไม่มีการจำกัด
disableFirstPartyIdentifiers
-
ปิดใช้ตัวระบุของบุคคลที่หนึ่งที่ใช้สําหรับการเลือกโฆษณา หากคุณอัปเดตการตั้งค่าตัวระบุของบุคคลที่หนึ่งสำหรับโฆษณาในแอปใน Ad Manager ภายในการตั้งค่าผู้ดูแลระบบ > การตั้งค่าส่วนกลาง ให้ใช้ API นี้เพื่อปิดใช้ตัวระบุดังกล่าวใน PAL โปรดทราบว่าการตั้งค่านี้ไม่มีผลกับการใช้ตัวระบุและพื้นที่เก็บข้อมูลในเครื่องเพื่อตรวจจับการเข้าชมที่ไม่ถูกต้อง
ตัวอย่างต่อไปนี้จะตั้งค่าพารามิเตอร์เหล่านี้
ConsentSettings consentSettings = ConsentSettings.builder()
.allowStorage(isConsentToStorage)
.build();
GoogleAdManagerSettings adManagerSettings = GoogleAdManagerSettings.builder()
// Add this line if the "Programmatic limited ads" toggle is turned
// off in Ad Manager.
.disableLimitedAdsStorage(true)
// Add this line if the
// "First party identifiers for ads on app" toggle is turned
// off in Ad Manager.
.disableFirstPartyIdentifiers(true)
.build();
nonceLoader = new NonceLoader(this, 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\nidentifiers\nfor ads on\napps**,\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/android/api/com/google/ads/interactivemedia/pal/GoogleAdManagerSettings.Builder#public-abstract-googleadmanagersettings.builder-disablelimitedadsstorage-boolean-toggle) - disables invalid traffic detection-only identifiers 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/android/api/com/google/ads/interactivemedia/pal/GoogleAdManagerSettings.Builder#public-abstract-googleadmanagersettings.builder-disablefirstpartyidentifiers-boolean-toggle) - disables first-party identifiers used for ad selection. If you updated the **First party\n identifiers\n for ads on\n apps** 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 identifiers and local storage for invalid traffic detection.\n\nThe following example sets these parameters: \n\n ConsentSettings consentSettings = ConsentSettings.builder()\n .allowStorage(isConsentToStorage)\n .build();\n\n GoogleAdManagerSettings adManagerSettings = GoogleAdManagerSettings.builder()\n // Add this line if the \"Programmatic limited ads\" toggle is turned\n // off in Ad Manager.\n .disableLimitedAdsStorage(true)\n // Add this line if the\n // \"First party identifiers for ads on app\" toggle is turned\n // off in Ad Manager.\n .disableFirstPartyIdentifiers(true)\n .build();\n\n nonceLoader = new NonceLoader(this, consentSettings, adManagerSettings);"]]