تبلیغات محدود و تنظیمات شناسه شخص اول
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
اگر تنظیمات Ad Manager تبلیغات محدود برنامهای یا کوکیهای شخص اول را برای تبلیغات در وب بهروزرسانی میکنید، از این APIهای جدید برای مطابقت با تنظیمات در Ad Manager استفاده کنید. اگر از API ها استفاده نمی کنید، PAL ممکن است شناسه هایی را در nonce که در درخواست تبلیغ به سرور استفاده می شود، شامل شود. با این حال، Ad Manager ممکن است سیگنالها را بر اساس تنظیمات موجود در Ad Manager حذف کند.
API ها به شرح زیر است:
-
disableLimitedAdsStorage
- کوکیهای فقط تشخیص ترافیک نامعتبر و استفاده از فضای ذخیرهسازی محلی را برای تبلیغات محدود غیرفعال میکند. اگر تنظیمات تبلیغات محدود برنامهنویسی را در Ad Manager در Admin > تنظیمات جهانی بهروزرسانی کردهاید، از این API برای غیرفعال کردن استفاده از فضای ذخیرهسازی محلی برای تبلیغات محدود در PAL استفاده کنید. توجه داشته باشید که این تنظیم برای تبلیغات نامحدود اعمال نمی شود. -
disableFirstPartyIdentifiers
- شناسه های شخص اول مورد استفاده برای انتخاب آگهی را غیرفعال می کند. اگر کوکیهای شخص اول را برای تبلیغات در تنظیمات وب در Ad Manager در Admin > تنظیمات جهانی بهروزرسانی کردهاید، از این 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);
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز 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\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);"]]