تبلیغات محدود و تنظیمات شناسه شخص اول
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
اگر تنظیمات Ad Manager تبلیغات محدود برنامهریزی یا شناسههای شخص اول را برای تبلیغات در برنامهها بهروزرسانی میکنید، از این APIهای جدید برای مطابقت با تنظیمات در Ad Manager استفاده کنید. اگر از API ها استفاده نمی کنید، PAL ممکن است شناسه هایی را در nonce که در درخواست تبلیغ به سرور استفاده می شود، شامل شود. با این حال، Ad Manager ممکن است سیگنالها را بر اساس تنظیمات موجود در Ad Manager حذف کند.
API ها به شرح زیر است:
-
disableLimitedAdsStorage
- شناسههای شناسایی نامعتبر ترافیک و استفاده از فضای ذخیرهسازی محلی را برای تبلیغات محدود غیرفعال میکند. اگر تنظیمات تبلیغات محدود برنامهنویسی را در Ad Manager در Admin > تنظیمات جهانی بهروزرسانی کردهاید، از این API برای غیرفعال کردن استفاده از فضای ذخیرهسازی محلی برای تبلیغات محدود در PAL استفاده کنید. توجه داشته باشید که این تنظیم برای تبلیغات نامحدود اعمال نمی شود. -
disableFirstPartyIdentifiers
- شناسه های شخص اول مورد استفاده برای انتخاب آگهی را غیرفعال می کند. اگر شناسههای شخص اول را برای تبلیغات در تنظیمات برنامهها در Admin در Admin > تنظیمات جهانی بهروزرسانی کردهاید، از این 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);
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-21 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-21 بهوقت ساعت هماهنگ جهانی."],[],[],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);"]]