Chế độ cài đặt quảng cáo bị hạn chế và giá trị nhận dạng của bên thứ nhất
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Nếu bạn cập nhật chế độ cài đặt Ad Manager Quảng cáo bị hạn chế có lập trình hoặc Giá trị nhận dạng của bên thứ nhất cho quảng cáo trên ứng dụng, hãy sử dụng các API mới này để khớp với chế độ cài đặt trong Ad Manager. Nếu bạn không sử dụng API, PAL có thể đưa các giá trị nhận dạng vào số chỉ dùng một lần được dùng trong yêu cầu quảng cáo gửi đến máy chủ. Tuy nhiên, Ad Manager có thể loại bỏ các tín hiệu dựa trên chế độ cài đặt trong Ad Manager.
Các API như sau:
disableLimitedAdsStorage
– tắt giá trị nhận dạng chỉ dùng để phát hiện lưu lượng truy cập không hợp lệ và việc sử dụng bộ nhớ cục bộ cho quảng cáo bị hạn chế. Nếu bạn đã cập nhật chế độ cài đặt Quảng cáo bị hạn chế có lập trình trong Ad Manager trong phần Quản trị > Cài đặt chung, hãy sử dụng API này để tắt chế độ sử dụng bộ nhớ cục bộ cho quảng cáo bị hạn chế trong PAL. Xin lưu ý rằng chế độ cài đặt này không áp dụng cho quảng cáo không bị giới hạn.
disableFirstPartyIdentifiers
– tắt mã nhận dạng của bên thứ nhất dùng để lựa chọn quảng cáo. Nếu bạn đã cập nhật chế độ cài đặt Giá trị nhận dạng của bên thứ nhất cho quảng cáo trên ứng dụng trong Ad Manager trong phần cài đặt Quản trị > Chung, hãy sử dụng API này để tắt các giá trị nhận dạng đó trong PAL. Xin lưu ý rằng chế độ cài đặt này không áp dụng cho việc sử dụng giá trị nhận dạng và bộ nhớ cục bộ để phát hiện lưu lượng truy cập không hợp lệ.
Ví dụ sau đây thiết lập các tham số này:
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);
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-21 UTC.
[null,null,["Cập nhật lần gần đây nhất: 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);"]]