با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
یک تبلیغ بینابینی وب را نمایش دهید
این مثال نشان می دهد که چگونه می توان یک تبلیغ بینابینی وب را با استفاده از کتابخانه برچسب ناشر Google (GPT) نمایش داد. بینابینی های وب، تبلیغات تمام صفحه با مدیریت GPT هستند که در پاسخ به اقدامات کاربر ظاهر می شوند. برای اطلاعات بیشتر در مورد بینابینی های وب، به ترافیک بینابینی های وب مراجعه کنید.
اقدامات کاربر زیر برای راه اندازی یک تبلیغ بینابینی وب واجد شرایط هستند:
مخفی کردن و سپس بازگشت به صفحه (مثلاً با تغییر زبانه ها).
unhideWindow
از کار افتاده است
بله
پشتیبانی از اقدامات اضافی کاربر ممکن است در آینده اضافه شود. برای بهروزرسانی ، یادداشتهای انتشار GPT را دنبال کنید.
نکات استفاده
برای اطمینان از تجربه کاربری بهینه، GPT فقط در صفحاتی که فرمت را به درستی پشتیبانی می کنند، تبلیغات بینابینی وب را درخواست می کند. بینابینیهای وب فقط زمانی پشتیبانی میشوند که GPT در پنجره بالا اجرا شود. در صفحاتی که بینابینی های وب را پشتیبانی نمی کنند، ممکن است defineOutOfPageSlot() null برگرداند. حتما این مورد را بررسی کنید تا دچار خطا نشوید.
فقط در صفحهها یا محیطهایی که میخواهید یک بینابینی نمایش داده شود، آگهیهای بینابینی وب را درخواست کنید. تبلیغات بینابینی وب واجد شرایط ارائه به دسکتاپ، رایانه لوحی و دستگاه های تلفن همراه هستند.
تبلیغات بینابینی وب جایگاه تبلیغاتی خود را ایجاد می کند. برخلاف سایر انواع تبلیغات، نیازی به تعریف <div> برای تبلیغات بینابینی وب ندارید. این تبلیغات به طور خودکار ظرف خود را در هنگام پر شدن یک آگهی ایجاد و در صفحه قرار می دهند.
تبلیغات بینابینی وب دارای محدودیت فرکانس ثابت هستند. این کار باعث میشود که به همان کاربر بیش از یک بار در هر ساعت، در هر زیردامنه، یک پیام بینابینی نشان داده شود.
تبلیغات بینابینی وب نیاز به دسترسی به فضای ذخیره سازی محلی دارند. برای ناشران ادغام شده با IAB Transparency and Consent Framework نسخه 2.0 ، این بدان معناست که رضایت برای هدف 1 برای عملکرد تبلیغات بینابینی وب لازم است.
برخی از پیوندهای موجود در یک صفحه ممکن است واجد شرایط نمایش تبلیغات بینابینی وب نباشند. وقتی کاربر روی پیوندی که واجد شرایط نیست کلیک کند، تبلیغات بینابینی نشان داده نمی شود، برای مثال، پیوندهایی به URL های بدون HTTP/HTTPS، و پیوندهایی که در یک پنجره جدید باز می شوند.
اگر از معماری تک درخواستی (SRA) در صفحهای با اسلاتهای متعدد استفاده میکنید، تا زمانی که divهای اسلات تبلیغاتی ایستا ایجاد نشدهاند display() را فراخوانی نکنید. همانطور که در Ad Best Practices توضیح داده شد، اولین فراخوانی برای display() هر جایگاه تبلیغاتی تعریف شده قبل از آن نقطه را درخواست می کند. اگرچه اسلات های بینابینی وب نیازی به <div> از پیش تعریف شده ندارند، اما اسلات های تبلیغاتی ایستا به آن نیاز دارند. فراخوانی display() قبل از حضور این عناصر در صفحه میتواند منجر به سیگنالهای با کیفیت پایینتر و کاهش درآمدزایی شود. به همین دلیل، توصیه می کنیم تماس اولیه را تا زمانی که شکاف های ثابت تعریف شده اند به تعویق بیندازید.
[null,null,[],[],[],null,["# Display a web interstitial ad\n=============================\n\nThis example demonstrates how to display a web interstitial ad using the Google\nPublisher Tag (GPT) library. Web interstitials are GPT-managed, full-page ads\nthat appear in response to user actions. For more information about web\ninterstitials, see [Traffic web interstitials](//support.google.com/admanager/answer/9840201).\n\nThe following user actions are eligible to trigger a web interstitial ad:\n\n| User action | [API name](//developers.google.com/publisher-tag/reference#googletag.config.interstitialconfig) | Default | Configurable |\n|-------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|----------|--------------|\n| Clicking on an anchor element. | N/A | Enabled | No |\n| Clicking on the browser navigation bar. (Desktop only) | `navBar` | Disabled | Yes |\n| Hiding and then returning to the page (for example, by switching tabs). | `unhideWindow` | Disabled | Yes |\n\n| **Important:** Default trigger states are [configurable in Google Ad Manager](//support.google.com/admanager/answer/9840201). If these values have been modified for your Ad Manager account, they may not match the preceding table.\n\nSupport for additional user actions may be added in the future. Follow the\n[GPT release notes](//developers.google.com/publisher-tag/release-notes) for updates.\n\nUsage notes\n-----------\n\n- **To ensure an optimal user experience, GPT only requests web interstitial\n ads on pages that properly support the format.** Web interstitials are only\n supported when GPT is running in the top window. On pages that don't support\n web interstitials, `defineOutOfPageSlot()` may return null. Be sure to check\n for this to avoid errors.\n\n- **Only request web interstitial ads on pages or environments where you want\n an interstitial to appear.** Web interstitial ads are eligible to serve to\n desktop, tablet, and mobile devices.\n\n | **Tip:** For best results, use `\u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\" /\u003e` on mobile pages, or avoid setting fixed widths and heights on your document, as that can result in poorly scaled interstitial ads.\n- **Web interstitial ads generate their own ad slot.** Unlike other ad types,\n you don't need to define a `\u003cdiv\u003e` for web interstitial ads. These ads\n automatically create and insert their own container into the page when an ad\n fills.\n\n- **Web interstitial ads have a configurable\n [frequency cap](//support.google.com/admanager/answer/9840201#frequency).** This prevents the same user from\n being shown an interstitial more than once per the specified window of time,\n per subdomain. The default frequency cap is 1 impression per 10 minutes, and\n the minimum allowed cap is 1 impression per 1 minute.\n\n- **Web interstitial ads require access to local storage.** For publishers\n integrated with the\n [IAB Transparency and Consent Framework v2.0](//support.google.com/admanager/answer/9805023), this means\n that consent for [Purpose 1](//support.google.com/admanager/answer/9461778#purposes) is required for web\n interstitial ads to function.\n\n- **Some links on a page might be ineligible to show web interstitial ads.**\n Interstitial ads won't show when a user clicks an ineligible link, for\n example, links to URLs without HTTP/HTTPS, and links that open in a new\n window.\n\n | **Note:** You can prevent specific links from triggering GPT-managed web interstitials by adding a `data-google-interstitial=\"false\"` attribute to the anchor element or any ancestor of the anchor element.\n- **If using single-request architecture (SRA) on a page with multiple slots,\n don't call `display()` until static ad slots divs are created.** As\n explained in [Ad Best Practices](//developers.google.com/publisher-tag/guides/ad-best-practices#use_single_request_architecture_correctly), the first call to `display()`\n requests every ad slot defined prior to that point. Although web\n interstitial slots don't require a predefined `\u003cdiv\u003e`, static ad slots do.\n Calling `display()` before these elements are present on the page can result\n in lower quality signals, reducing monetization. Because of this, we\n recommend delaying the initial call until after the static slots are\n defined.\n\nSample implementation\n---------------------\n\n[View demo](https://googleads.github.io/google-publisher-tag-samples/display-web-interstitial-ad/js/demo.html) This sample makes use of library features that are not fully supported when running in an iframe. To view a demo of this sample in a new window, click the **View demo** button above. \n\n### JavaScript\n\nLoading...\n----------\n\nLoading...\n----------\n\n[Improve this sample](https://github.com/googleads/google-publisher-tag-samples/tree/main/dist/display-web-interstitial-ad/js) [Report an issue](https://github.com/googleads/google-publisher-tag-samples/issues/new?labels=documentation&template=sample-feedback.md&title=Sample+feedback%3A+display-web-interstitial-ad/js)\n\n### TypeScript\n\nLoading...\n----------\n\nLoading...\n----------\n\n[Improve this sample](https://github.com/googleads/google-publisher-tag-samples/tree/main/dist/display-web-interstitial-ad/ts) [Report an issue](https://github.com/googleads/google-publisher-tag-samples/issues/new?labels=documentation&template=sample-feedback.md&title=Sample+feedback%3A+display-web-interstitial-ad/ts)"]]