Google Interactive Media Ads SDK: часто задаваемые вопросы
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
- Почему я не получаю рекламу для всех форматов?
- Теги тестовых объявлений настроены так, чтобы всегда возвращать объявления по действительным запросам. Это призвано облегчить интеграцию и упростить тестирование того, как ваш проигрыватель запрашивает и отображает рекламу. Однако объявления не всегда доступны во всех форматах для вашего сайта, аккаунта или рекламного блока. Если ваша интеграция работает правильно для тестового тега, но не для вашего собственного тега, причина может быть одной из следующих:
- Вы передаете в свою среду видео неподдерживаемого формата. Например, вы показываете только объявления HTML5 на iOS или Android.
- Если вы используете Менеджер рекламы, возможно, в настоящее время для вашего идентификатора издателя нет объявлений, ориентированных на него. Также убедитесь, что вы одобрили соответствующие объявления и креативы в Менеджере рекламы.
- Если вы используете AdSense, критерии таргетинга вашего сайта или тестовой страницы могут не содержать активных рекламных объявлений. Наиболее распространенной причиной является использование частных несканируемых веб-сайтов.
- Если вы используете систему управления партнерами сети Ad Exchange, а
descriptionURL
не задан или не указан в списке управления принадлежащими или управляемыми доменами, объявления на нем показываться не будут. - Проверьте пороговые значения минимальной цены за тысячу показов, определенные в Ad Exchange Video. Достаточно высокая цена за тысячу показов может привести к очень низкой заполняемости. Чтобы исправить это, попробуйте удалить минимальную цену за тысячу показов или параметр рекламного блока из запроса объявления (например, название рекламного места), чтобы проверить, влияет ли это на заполняемость.
- Как выглядит хороший
descriptionUrl
? - Чтобы быть наиболее эффективным, содержимое страницы, на которую указывает
descriptionUrl
, не должно представлять собой набор слов или фраз, а должно состоять из 1–3 абзацев, фактически описывающих контент и вашу роль в его предоставлении. Один из методов, который был успешным в прошлом, — это динамическое объединение содержимого descriptionUrl
из предопределенных блоков. Например, несколько предложений о содержании, несколько предложений о предложениях вашего сайта, а затем несколько предопределенных фрагментов, связанных с каждым каналом AdSense (например, «Развлечения» или «Спорт»). В результате с каждым фрагментом контента связан достаточно отдельный descriptionUrl
, который предоставляет как общую информацию (например, дескрипторы жанра), так и конкретную информацию (непосредственно информацию о контенте). Этот HTML-код метаданных должен быть простым, например:
<html>
<head>
<title>Domain.com - Your tag line here!</title>
</head>
<body>
<h1>Descriptions</h1>
<h2>About this Content</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. ...</p>
<h2>About Domain.com</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. ...</p>
</body>
</html>
- Почему я получаю сообщение об ошибке «Ответ на объявление не содержит допустимого типа объявления»?
- Эта ошибка обычно возникает из-за того, что ни одна реклама не была ориентирована на определенный
publisherId
(за определенный период времени). Это состояние может меняться в течение дня или в течение нескольких дней в зависимости от начала и окончания кампании. Вам следует убедиться, что срок действия объявления, на которое вы хотите настроить таргетинг, не истек и что критерии таргетинга объявления верны. Если объявления правильно запрашиваются, получаются и отображаются с использованием тестового publisherId
, вы можете быть уверены, что эти объявления правильно обрабатываются с использованием вашего действующего publisherId
, когда объявления доступны. - Есть ли у вас тег видеообъявления Менеджера рекламы, который я могу использовать для тестирования?
- Образцы тегов доступны на странице образцов тегов .
- Должен ли я установить
adSlotWidth
и adSlotHeight
те же значения, что и для sz
в теге объявления Менеджера рекламы? - Не обязательно.
adSlotWidth
и adSlotHeight
должны соответствовать ширине/высоте игрока или области, которую вы хотите заполнить своей рекламой. Они используются AdSense, чтобы определить, какие объявления подходят для этого места. Пара ключ/значение sz
в теге объявления Менеджера рекламы является параметром таргетинга и не обязательно влияет на отображаемый креатив (подробнее см. ниже). - Демо-тег объявления выглядит великолепно, но когда я переключаю его на свой рекламный тег, реклама не появляется.
- Убедитесь, что что-то передается по запрашиваемому вами тегу объявления. Самый простой способ это выяснить — посмотреть HTTP-трафик. Если изображение grey.gif размером 1 x 1 пиксель возвращается в блоке привязки HTML, вам необходимо проверить таргетинг в Менеджере рекламы.
- Я хочу запросить рекламу с использованием одного и того же тега несколько раз, но получаю рекламу только по первому запросу. Как мне это исправить?
- Когда вы запрашиваете рекламу более одного раза, вам необходимо сообщить рекламному серверу, что это законные запросы, а не случайные дубликаты. SDK сделает это за вас с помощью двух быстрых вызовов API:
- Вызовите
destroy()
в своем экземпляре AdsManager
. Это предотвращает воспроизведение любых построллов при выполнении приведенного ниже вызова contentComplete()
. Вы получите новый AdsManager
, когда сделаете следующий запрос. - Вызовите
contentComplete()
в своем экземпляре AdsLoader
. При этом SDK сбрасывается, и новый запрос объявления не выглядит как копия предыдущего.
После выполнения двух вызовов, описанных выше, вы можете вызвать requestAds()
в своем экземпляре AdsLoader
, чтобы получить еще один набор рекламы для воспроизведения вашего нового видео. - Как запросить наложения и полноэкранные объявления AdSense с помощью IMA SDK?
Чтобы запросить рекламу AdSense с помощью SDK, вам необходимо сначала получить рекламный тег AdSense. Подробнее об этом можно узнать на странице AdSense для видео . Получив тег, вам необходимо выполнить следующие шаги, чтобы создать запрос на наложение или полное рекламное место:
Накладываемые объявления- В вашем
AdsRequest
установите для параметра ViewModes значение NORMAL
. - В тег объявления добавьте параметр
overlay=1
.
Полноразмерные объявления- В вашем
AdsRequest
установите для параметра ViewModes значение FULLSCREEN
. - В тег объявления добавьте параметр
overlay=0
.
- Когда я нажимаю на свое объявление, я получаю сообщение об ошибке «Неверный URL перехода по клику». В чем может быть причина?
- Наиболее распространенной причиной этой ошибки является неправильно экранированный URL перехода по клику. Если вы видите эту ошибку, убедитесь, что URL перехода по клику правильно экранирован в ответе VAST.
- Есть ли в SDK для Android и iOS способ сделать всю видеорекламу кликабельной?
- Что касается отслеживания кликов по всему видео, то стандартный опыт просмотра мобильного видео заключается в том, что нажатие на видео либо приостанавливает его, либо вызывает элементы управления проигрывателем. Чтобы пользователи не случайно нажимали на рекламу, хотя на самом деле им просто нужен доступ к элементам управления проигрывателем, IMA использует кнопку «Подробнее» , позволяющую пользователям нажимать на рекламу и узнавать больше о рекламируемом продукте.
- Почему я вижу ошибку «Документ VAST пуст»?
- Эта ошибка возникает, когда тег объявления возвращает пустой документ VAST, что указывает на то, что объявление не было показано должным образом. Поговорите со своим менеджером по работе с клиентами или представителем рекламного сервера, чтобы узнать, почему ваш рекламный тег не работает.
- Могу ли я изменить размер/текст поля пропуска рекламы или других элементов пользовательского интерфейса?
- Пакеты SDK IMA не поддерживают изменение макета, размера или содержимого элементов пользовательского интерфейса. Дополнительные сведения об элементах пользовательского интерфейса см. в
AdsManager.uiElements
. - Почему во время выполнения я получаю ошибки «Нет виртуального метода»?
Сообщения об ошибках, подобные приведенным ниже, вызваны использованием более старой версии сервисов Google Play, которая не включает рекламный идентификатор.
No virtual method
getInfo()Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info; in
class Lcom/google/android/gms/ads/identifier/AdvertisingIdClient; or its
super classes (declaration of 'com.google.android.gms.ads.identifier.AdvertisingIdClient'
Обновление до версии 4.0 или новее (но желательно последней) решает эту проблему.
- Могу ли я использовать несколько потоков для инициализации пользовательского интерфейса и управления им?
- Нет, вся инициализация и манипуляции с пользовательским интерфейсом должны выполняться в основном потоке. В Android объекты пользовательского интерфейса не являются потокобезопасными. См. Темы для получения дополнительной информации.
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-08-29 UTC.
[null,null,["Последнее обновление: 2025-08-29 UTC."],[[["\u003cp\u003eThe test ad tags always return ads for valid requests to help with integration and testing; however, live ads might not always be available due to factors like ad targeting, formats, and publisher settings.\u003c/p\u003e\n"],["\u003cp\u003eWhen using your own ad tag, ensure it's properly trafficked and targeted in Ad Manager to avoid issues like no ads appearing or a 1x1 pixel grey.gif being returned.\u003c/p\u003e\n"],["\u003cp\u003eFor repeated ad requests using the same tag, use \u003ccode\u003edestroy()\u003c/code\u003e on the \u003ccode\u003eAdsManager\u003c/code\u003e and \u003ccode\u003econtentComplete()\u003c/code\u003e on the \u003ccode\u003eAdsLoader\u003c/code\u003e to prevent duplicate requests and ensure proper ad serving.\u003c/p\u003e\n"],["\u003cp\u003eAn "Ad response does not contain a valid ad type" error usually indicates an issue with ad targeting for your publisher ID; verify the ad's status and targeting criteria in Ad Manager.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eadSlotWidth\u003c/code\u003e and \u003ccode\u003eadSlotHeight\u003c/code\u003e should be set to the player's dimensions for ad fitting, while the \u003ccode\u003esz\u003c/code\u003e parameter in the Ad Manager tag is for targeting and may not directly influence creative selection.\u003c/p\u003e\n"]]],[],null,["# Google Interactive Media Ads SDK FAQs\n\n- [Why am I not getting ads back for all formats?](#1)\n- [What does a good descriptionUrl look like?](#2)\n- [Why am I receiving the error \"Ad response does not contain a valid ad type\"?](#3)\n- [Do you have an Ad Manager video ad tag that I can use for testing?](#4)\n- [Should I set the adSlotWidth and adSlotHeight to the same values\n as the sz in my Ad Manager ad tag?](#5)\n- [The demo ad tag looks great, but when I switch it with my ad tag,\n no ad appears.](#7)\n- [I want to request ads using the same tag more than once, but I\n only get ads for my first request. How do I fix this?](#8)\n- [How do I request overlay and full slot AdSense ads using the IMA\n SDK?](#9)\n- [I'm getting an \"Invalid clickthrough URL\" error when I click on my\n ad. What could be the cause?](#10)\n- [In the Android and iOS SDKs, is there a way to make the entire video\n ad clickable?](#11)\n- [Why do I see a \"VAST Document Empty\" error?](#12)\n- [Can I change the size/text of the \"Skip Ad\" box or other UI elements?](#13)\n- [Why am I getting \"No virtual method\" errors at runtime?](#14)\n- [Can I use multiple threads to initialize and manipulate the UI?](#18)\n\n*** ** * ** ***\n\nWhy am I not getting ads back for all formats?\n:\n The test ad tags are set up to always return ads for valid requests. This is\n meant to facilitate integration and make it easier to test how your player\n requests and renders ads. However, ads are not always available in every\n format for your site, account, or ad unit. If your integration is working\n properly for the test tag but not for your own tag, the cause may be one of\n the following:\n\n - You're serving videos of an unsupported format to your environment. For example, you're serving only HTML5 ads to iOS or Android.\n - If you're using Ad Manager, your publisher ID may not have any ads targeted to it at this time. Also, ensure that you have approved the relevant ads and creatives in Ad Manager.\n - If you're using AdSense, the targeting criteria for your site or test page may not have any active advertisements. The most common cause is the use of private, uncrawled websites.\n - If you're using Ad Exchange Network Partner Management and `descriptionURL` is not set or is not on the owned or operated domains management list, ads do not serve to this.\n - Check the *minCPM* thresholds defined in Ad Exchange Video. A fairly high CPM may result in very low fill rates. To correct this, try either removing the minCPM or removing the ad unit parameter from the ad request (i.e., slotname) to verify whether this is affecting the fill rate.\n\nWhat does a good `descriptionUrl` look like?\n:\n To be most effective, the content of the page that `descriptionUrl`\n points to shouldn't be a collection of words or phrases but rather\n 1-3 paragraphs actually describing the content and your role in providing it.\n One method that has been successful in the past is to stitch together\n `descriptionUrl` page content dynamically from predefined blocks.\n For example, a few sentences about the content, a few sentences about your\n site's offering, and then a few predefined snippets associated with each\n AdSense channel (like \"Entertainment\" or \"Sports\"). As a result, each piece of\n content has a reasonably distinct `descriptionUrl` associated with\n it that provides both general information (such as genre descriptors) as well\n as specific information (content about the content directly).\n\n This metadata HTML should be simple, for example:\n\n ```text\n \u003chtml\u003e\n \u003chead\u003e\n \u003ctitle\u003eDomain.com - Your tag line here!\u003c/title\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n \u003ch1\u003eDescriptions\u003c/h1\u003e\n \u003ch2\u003eAbout this Content\u003c/h2\u003e\n \u003cp\u003eLorem ipsum dolor sit amet, consectetur adipiscing elit. ...\u003c/p\u003e\n \u003ch2\u003eAbout Domain.com\u003c/h2\u003e\n \u003cp\u003eLorem ipsum dolor sit amet, consectetur adipiscing elit. ...\u003c/p\u003e\n \u003c/body\u003e\n \u003c/html\u003e\n \n ```\n\nWhy am I receiving the error \"Ad response does not contain a valid ad type\"?\n: This error generally appears because no ads have been targeted to the\n specific `publisherId` (for the given time period). This condition\n may vary throughout the day, or over several days as campaigns begin and end.\n You should check that the ad you wish to target has not expired and that the\n ad targeting criteria are correct.\n As long as ads are properly requested, received, and rendered using\n the test `publisherId`, you can be sure that these ads are\n properly handled using your live `publisherId` when the ads are\n available.\n\nDo you have an Ad Manager video ad tag that I can use for testing?\n: Sample tags are available on the [sample tags](/interactive-media-ads/docs/sdks/android/client-side/tags) page.\n\nShould I set the `adSlotWidth` and `adSlotHeight` to the same\nvalues as the `sz` in my Ad Manager ad tag?\n: Not necessarily. The `adSlotWidth` and `adSlotHeight`\n must be set to the width/height of the player or area you want your ads to\n fill. They are used by AdSense to determine which ads are available to fit\n into that space. The `sz` key/value pair in your Ad Manager ad tag is\n a targeting parameter and does not necessarily affect the creative served\n (more information below).\n\nThe demo ad tag looks great, but when I switch it with my ad tag, no ad appears.\n:\n Check to ensure that something is trafficked to the ad tag you are\n requesting. The easiest way to find out is to watch the HTTP traffic. If a\n **1x1 pixel grey.gif** image is returned within an HTML anchor block,\n then you need to check your targeting in Ad Manager.\n\nI want to request ads using the same tag more than once, but I only get ads for my first\nrequest. How do I fix this?\n:\n When you request ads more than once, you need to let the ad server know\n that these are legitimate requests, and not accidental duplicates. The SDK\n does this for you with two quick API calls:\n\n 1. Call `destroy()` on your `AdsManager` instance. This prevents any post-rolls from playing when you make the below call to `contentComplete()`. You get a new `AdsManager` when you make your next request.\n 2. Call `contentComplete()` on your `AdsLoader` instance. This resets the SDK so the new ad request doesn't look like a duplicate of the previous one.\n\n\n After making the two calls above, you can call `requestAds()` on\n your `AdsLoader` instance to get another set of ads to play for your\n new video.\n\nHow do I request overlay and full slot AdSense ads using the IMA SDK?\n\n: To request AdSense ads using the SDK, you need to first obtain an AdSense\n ad tag. You can learn more about that on the [AdSense\n for Video page](//support.google.com/adsense/answer/1705822). Once you have your tag, you need to take the following\n steps to make either an overlay or a full slot ad request:\n\n **Overlay ads**\n\n 1. In your `AdsRequest`, set your ViewModes to `NORMAL`.\n 2. In your ad tag, add the parameter `overlay=1`.\n\n **Full slot ads**\n\n 1. In your `AdsRequest`, set your ViewModes to `FULLSCREEN`.\n 2. In your ad tag, add the parameter `overlay=0`.\n\nI'm getting an \"Invalid clickthrough URL\" error when I click on my ad. What could be the cause?\n:\n The most common cause for this error is an improperly escaped clickthrough\n URL. If you're seeing this error, check to make sure that your clickthrough\n URL is properly escaped in your VAST response.\n\nIn the Android and iOS SDKs, is there a way to make the entire video ad clickable?\n: As far as whole-video click tracking goes, the standard viewer experience\n for mobile video that has emerged is that tapping on a video either\n pauses it or brings up the player controls. To avoid users\n unintentionally clicking on ads when they really just want access to the\n player controls IMA uses the **Learn more** button to let\n users click on an ad and learn more about the product being advertised.\n\nWhy do I see a \"VAST Document Empty\" error?\n: This error occurs when the ad tag returns an empty VAST document, indicating\n that the ad was not served properly. Talk to your account manager\n or ad server representative to see why your ad tag is not working.\n\nCan I change the size/text of the **Skip Ad** box or other UI elements?\n: The IMA SDKs do not support changing the layout, size, or content of UI elements.\n For more details on UI elements, see `AdsManager.uiElements`.\n\nWhy am I getting \"No virtual method\" errors at runtime?\n\n: Error messages similar to the following are caused by using an older version\n of Google Play services that does not include the advertising ID.\n\n ```\n No virtual method\n getInfo()Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info; in\n class Lcom/google/android/gms/ads/identifier/AdvertisingIdClient; or its\n super classes (declaration of 'com.google.android.gms.ads.identifier.AdvertisingIdClient'\n ```\n\n Upgrading to version 4.0 or later (but preferably the latest) solves this problem.\n\nCan I use multiple threads to initialize and manipulate the UI?\n:\n\n No, all initialization and manipulation of the UI must be done on the\n main thread. In Android, UI objects are not thread-safe. See\n [Threads](//developer.android.com/guide/components/processes-and-threads.html#Threads) for more information."]]