با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
از کلید-مقدارها می توان برای هدف قرار دادن تبلیغات به صورت جزئی تر از واحدهای تبلیغاتی استفاده کرد. درباره کلید-مقدارها بیشتر بیاموزید.
برای هر درخواست تبلیغ، میتوانید یک یا چند کلید را ارسال کنید که هر کدام یک یا چند مقدار مرتبط دارند. این کلید-مقدارها در مقابل گزینههای هدفیابی پیکربندیشده در سطح مورد خط در Ad Manager ارزیابی میشوند. به عنوان مثال، اگر یک کلید-مقدار سفارشی age=18-34 را پاس کنید، اقلام خطی که برای محدوده سنی 18-34 سال هدف گذاری شده اند، با فرض مطابقت همه معیارهای دیگر، واجد شرایط ارائه خدمات خواهند بود.
هدف گذاری را تنظیم کنید
میتوانید مقادیر کلیدی را برای پیکربندی هدفگیری در سطح شکاف و صفحه بر اساس نیازهای شبکه خود تعیین کنید.
در سطح اسلات
به شما امکان می دهد مقادیر کلیدی را برای جایگاه های تبلیغاتی جداگانه در صفحه خود تنظیم کنید.
هدف گذاری در سطح اسلات به شما امکان می دهد هدف گذاری را بر اساس هر اسلات پیکربندی کنید. این در مواردی مفید است که اسلاتهای جداگانه در یک صفحه به هدفگیری متفاوتی نیاز دارند، اما در موقعیتهایی که کلید-مقدارهای یکسان برای همه اسلاتها اعمال میشود، میتواند ناکارآمد باشد. از Slot.setTargeting() برای استفاده از هدف گذاری در سطح اسلات، مانند مثال زیر استفاده کنید.
سطح صفحه
به شما امکان میدهد کلید-مقدارها را در همه جایگاههای تبلیغات در صفحه خود تنظیم کنید.
هدفگذاری در سطح صفحه تضمین میکند که همه جایگاههای تبلیغات دارای مجموعهای از کلید-مقدارهای یکسان هستند. در برخی موارد این ممکن است مقدار کل کد مورد نیاز برای پیکربندی هدف را کاهش دهد. از googletag.pubads().setTargeting() برای استفاده از هدف گذاری در سطح صفحه مانند مثال زیر استفاده کنید.
در این مثال، دو جایگاه تبلیغاتی تعریف شده است که واحد تبلیغات /6355419/Travel/Asia و اندازه تبلیغ 728x90 را مشخص می کند. سپس هدف گذاری کلید-مقدار برای محدود کردن و متمایز کردن بیشتر تبلیغاتی که ممکن است در هر شکاف ارائه شوند اعمال می شود.
هنگامی که هم هدف گذاری در جایگاه و هم در سطح صفحه استفاده می شود، کلید-مقدارها با هم ترکیب می شوند و فقط تبلیغاتی که همه معیارها را برآورده می کنند واجد شرایط ارائه به یک اسلات معین خواهند بود. در این مثال، برچسب گذاری موثر برای هر شکاف به صورت زیر است:
جایگاه آگهی
هدف گذاری موثر
1
color=red AND position=atf AND interests=basketball
2
position=btf AND interests=basketball
چندین کلید یا مقادیر را هدف قرار دهید
در مثال قبل، ترکیبی از هدفگیری در جایگاه و سطح صفحه برای تعریف کلیدهای هدفگیری متعدد برای یک جایگاه تبلیغاتی استفاده شد. در اینجا چند رویکرد جایگزین برای دستیابی به همان هدف گذاری مؤثر وجود دارد:
فقط هدف گیری در سطح اسلات
در این مثال، کلید-مقدارهای مشترک برای هر جایگاه تبلیغاتی تکرار می شوند.
همچنین می توان با ارائه یک آرایه از مقادیر هنگام فراخوانی setTargeting() چندین مقدار را برای یک کلید هدف قرار داد:
// Page-level targeting with multiple values for a single key.
googletag.pubads().setTargeting('interests', ['baseball', 'basketball']);
هدف گذاری را پاک کنید
پس از تعیین هدف گذاری، کلید-مقدارهای پیکربندی شده با هر درخواست تبلیغاتی برای طول عمر جایگاه آگهی ارسال می شود. با این حال، در برخی شرایط، ممکن است مطلوب باشد که هدف گذاری در طول زمان تغییر کند. در حالی که setTargeting() می توان برای افزودن و بازنویسی کلید-مقدارها استفاده کرد، حذف آنها از این طریق ممکن نیست. برای انجام این کار، Slot.clearTargeting() یا googletag.pubads().clearTargeting() باید به جای آن استفاده شود.
هنگامی که clearTargeting() با یک کلید خاص (چه در سطح شکاف یا صفحه) فراخوانی می شود، تنها آن کلید حذف می شود. وقتی هیچ کلیدی مشخص نشده باشد، تمام هدف گذاری در آن سطح حذف می شود.
در مثال قبل، هدف گذاری موثر برای جایگاه تبلیغاتی پس از هر مرحله عبارت است از:
مرحله
هدف گذاری موثر
0
color=red AND position=atf AND interests=basketball
تاریخ آخرین بهروزرسانی 2024-11-15 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2024-11-15 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eKey-values offer granular ad targeting beyond ad units, enhancing ad relevance by enabling specific criteria like age or interests for ad delivery.\u003c/p\u003e\n"],["\u003cp\u003eSlot-level targeting allows customization for individual ad slots, while page-level targeting applies to all slots on a page, streamlining setup when uniform targeting is desired.\u003c/p\u003e\n"],["\u003cp\u003eCombining slot- and page-level targeting creates layered targeting, where ads must satisfy all criteria to be eligible for serving, enhancing ad precision.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Ad Manager has functions for clearing targeting, such as \u003ccode\u003eclearTargeting()\u003c/code\u003e, which allows removal of specific keys or all targeting at a particular level, providing flexibility in dynamic ad scenarios.\u003c/p\u003e\n"]]],["Key-values refine ad targeting at the slot or page level. Slot-level targeting uses `Slot.setTargeting()` for individual ad slots. Page-level targeting, using `googletag.pubads().setTargeting()`, applies to all slots. Both can be combined, with slot-level values taking precedence. Multiple values for one key are set using an array. To remove key-values use `Slot.clearTargeting()` or `googletag.pubads().clearTargeting()`. Remember, page-level key values can be modified but not removed at the slot level.\n"],null,["# Key-value targeting\n\nKey-values can be used to target ads more granularly than ad units. Learn more\nabout [key-values](//support.google.com/admanager/answer/188092).\n| **Warning:** Use key-value targeting with care. Under the terms of your contract, you must not pass any data that Google Ad Manager could [use or recognize as\n| personally identifiable information](//support.google.com/admanager/answer/7686480).\n\nFor each ad request, you may pass one or more keys, each with one or more\nassociated values. These key-values will be evaluated against targeting options\nconfigured at the line item-level in Ad Manager. For example, if\nyou pass a custom key-value of `age=18-34`, line items targeted to the age range\n18-34 will be eligible to serve, assuming all other criteria matches.\n\nSet targeting\n-------------\n\nYou may specify key-values to configure targeting at both the slot- and\npage-level based on your network's needs.\n\nSlot-level\n\n: Allows you to set key-values for individual ad slots on your page.\n\n Slot-level targeting allows you to configure targeting on a per-slot basis.\n This is useful in cases where individual slots on the same page require\n different targeting, but can be inefficient in situations where the same\n key-values are applied to all slots. Use\n [`slot.setConfig({ targeting: ... })`](/publisher-tag/reference#googletag.config.SlotSettingsConfig.targeting) to utilize\n slot-level targeting, as in the following example.\n\nPage-level\n\n: Allows you to set key-values across all ad slots on your page.\n\n Page-level targeting ensures that all ad slots have the same set of\n key-values. In some cases this may reduce the total amount of code needed to\n configure targeting. Use\n [`googletag.setConfig({ targeting: ... })`](/publisher-tag/reference#googletag.config.PageSettingsConfig.targeting) to\nutilize page-level targeting, as in the following example. \n\n```javascript\nwindow.googletag = window.googletag || { cmd: [] };\n\n// GPT slots\nlet adSlots = [];\n\ngoogletag.cmd.push(() =\u003e {\n // Configure slot-level targeting.\n adSlots[0] = googletag\n .defineSlot(\"/6355419/Travel/Asia\", [728, 90], \"banner-ad-1\")\n .addService(googletag.pubads());\n adSlots[0].setConfig({\n targeting: {\n color: \"red\",\n position: \"atf\",\n },\n });\n\n adSlots[1] = googletag\n .defineSlot(\"/6355419/Travel/Asia\", [728, 90], \"banner-ad-2\")\n .addService(googletag.pubads());\n adSlots[1].setConfig({\n targeting: {\n position: \"btf\",\n },\n });\n\n // Configure page-level targeting and enable SRA.\n googletag.setConfig({\n targeting: {\n interests: \"basketball\",\n },\n singleRequest: true,\n });\n\n // Enable services.\n googletag.enableServices();\n});\n```\n\nIn this example, two ad slots are defined which specify ad unit\n`/6355419/Travel/Asia` and ad size `728x90`. Then key-value targeting is\napplied to further restrict and differentiate the ads which may serve in each\nslot.\n\nWhen both slot- and page-level targeting are used, the key-values are combined\nand only ads satisfying all criteria will be eligible to serve to a given slot.\nIn this example, the effective tageting for each slot is:\n\n| Ad slot | Effective targeting |\n|---------|-------------------------------------------------------|\n| 1 | `color=red AND position=atf AND interests=basketball` |\n| 2 | `position=btf AND interests=basketball` |\n\n| **Note:** If the same targeting key is defined at both the page- and slot-level, the slot-level value will take precedence for that slot.\n\n### Target multiple keys or values\n\nIn the preceding example, a combination of slot- and page-level targeting was\nused to define multiple targeting keys for a single ad slot. Here are some\nalternative approaches to achieve the same effective targeting: \n\n### Slot-level targeting only\n\nIn this example, shared key-values are repeated for each ad slot. \n\n // Slot-level targeting with multiple keys.\n adSlots[0] = googletag\n .defineSlot('/6355419/Travel/Asia', [728, 90], 'banner-ad-1')\n .addService(googletag.pubads());\n adSlots[0].setConfig({\n targeting: {\n color: 'red',\n position: 'atf',\n interests: 'basketball'\n }\n });\n adSlots[1] = googletag\n .defineSlot('/6355419/Travel/Asia', [728, 90], 'banner-ad-2')\n .addService(googletag.pubads());\n adSlots[1].setConfig({\n targeting: {\n position: 'btf',\n interests: 'basketball'\n }\n });\n\n### Page-level default targeting\n\nIn this example, default targeting is set at the page-level and overridden\nat the slot-level as necessary.\n**Caution:** Key-values set at the page-level cannot be cleared at the slot-level, only modified. \n\n // Page-level default targeting.\n googletag.setConfig({\n targeting: {\n interests: 'basketball',\n position: 'btf'\n }\n });\n\n // Slot-level targeting overrides.\n adSlots[0] = googletag\n .defineSlot('/6355419/Travel/Asia', [728, 90], 'banner-ad-1')\n .addService(googletag.pubads());\n adSlots[0].setConfig({\n targeting: {\n color: 'red',\n position: 'atf'\n }\n });\n adSlots[1] = googletag\n .defineSlot('/6355419/Travel/Asia', [728, 90], 'banner-ad-2')\n .addService(googletag.pubads());\n\nIt's also possible to target multiple values for a single key by providing an\narray of values when calling `setConfig()`: \n\n // Page-level targeting with multiple values for a single key.\n googletag.setConfig({ targeting: { interests: ['baseball', 'basketball'] } });\n\nClear targeting\n---------------\n\nOnce targeting has been set, the configured key-values will be sent with every\nad request for the life of the ad slot. In some circumstances, however, it may\nbe desirable for targeting to change over time. While `setConfig()` can be\nused to add and overwrite key-values, it's not possible to remove them this way.\nTo accomplish that, you must clear the targeting by setting the value to `null`\nin the `setConfig()` method. \n\n```javascript\n// Step 0, define slot- and page-level targeting.\nadSlots[0] = googletag\n .defineSlot(\"/6355419/Travel/Asia\", [728, 90], \"banner-ad-1\")\n .addService(googletag.pubads());\nadSlots[0].setConfig({\n targeting: {\n color: \"red\",\n position: \"atf\",\n },\n});\n\ngoogletag.setConfig({\n targeting: {\n interests: \"basketball\",\n },\n singleRequest: true,\n});\n\n// Step 1, clear slot-level color targeting.\nadSlots[0].setConfig({\n targeting: {\n color: null,\n },\n});\n\n// Step 2, clear all page-level targeting.\ngoogletag.setConfig({\n targeting: null,\n});\n```\n\nWhen `clearTargeting()` is called with a specific key (either at the\nslot- or page- level), only that key is removed. When no key is specified, all\ntargeting at that level is removed.\n\nIn the preceding example, the effective targeting for the ad slot after each\nstep is:\n\n| Step | Effective targeting |\n|------|-------------------------------------------------------|\n| 0 | `color=red AND position=atf AND interests=basketball` |\n| 1 | `position=atf AND interests=basketball` |\n| 2 | `position=atf` |"]]