I tag annuncio di test sono configurati in modo da restituire sempre annunci per le richieste valide. Questo è
ha lo scopo di facilitare l'integrazione e di testare
il modo in cui il player
richieste e visualizza gli annunci. Tuttavia, gli annunci non sono sempre disponibili in ogni
formato predefinito per il tuo sito, account o unità pubblicitaria. Se l'integrazione funziona
correttamente per il tag di verifica, ma non per il tuo tag, la causa potrebbe essere una delle seguenti:
le seguenti:
Stai pubblicando video in un formato non supportato nel tuo ambiente. Ad esempio:
pubblichi annunci HTML5 solo per iOS o Android.
Se utilizzi Ad Manager, è possibile che per il tuo ID publisher non siano presenti annunci indirizzati a
in questo momento. Inoltre, assicurati di aver approvato gli annunci pertinenti e
le creatività in Ad Manager.
Se utilizzi AdSense, i criteri di targeting per il sito o la pagina di test possono
non hanno annunci attivi. La causa più comune è l'utilizzo di
siti web privati non sottoposti a scansione.
Se utilizzi la Gestione dei partner di rete di Ad Exchange e
descriptionURL non è impostato o non è di proprietà o gestito
di gestione dei domini, gli annunci non vengono pubblicati in questo elenco.
Controlla le soglie minCPM definite in Ad Exchange Video. R
un CPM abbastanza elevato può comportare tassi di riempimento molto bassi. Per risolvere il problema, prova a
rimuovendo il CPM minimo o il parametro dell'unità pubblicitaria dalla richiesta di annuncio
(ad es. slotname) per verificare se questo influisce sul tasso di riempimento.
Che aspetto ha un descriptionUrl di buona qualità?
Per essere più efficaci, i contenuti della pagina descriptionUrl
punti a non dovrebbe essere un insieme di parole o frasi ma
1-3 paragrafi che descrivono in realtà i contenuti e il ruolo che assumi nella relativa fornitura.
Un metodo che ha avuto successo in passato è quello di unire
Contenuti della pagina descriptionUrl in modo dinamico da blocchi predefiniti.
Ad esempio, alcune frasi sui contenuti, alcune frasi sui tuoi
dell'offerta del sito e alcuni snippet predefiniti associati a ogni
Canale AdSense (ad es. "Intrattenimento" o "Sport"). Di conseguenza, ogni parte
per i contenuti è associata a un elemento descriptionUrl ragionevolmente distinto
che fornisca sia informazioni generali (come descrittori di genere) sia
come informazioni specifiche (contenuti che riguardano direttamente i contenuti).
Il codice HTML dei metadati deve essere semplice, ad esempio:
<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>
Perché viene visualizzato l'errore "La risposta dell'annuncio non contiene un tipo di annuncio valido"?
In genere questo errore viene visualizzato perché nessun annuncio è stato indirizzato alla
publisherId specifico (per il periodo di tempo specificato). Questa condizione
possono variare nel corso della giornata o per diversi giorni all'inizio e alla fine delle campagne.
Devi controllare che l'annuncio che vuoi scegliere come target non sia scaduto e che la
che i criteri di targeting degli annunci siano corretti.
Purché gli annunci vengano richiesti, ricevuti e visualizzati correttamente
il test publisherId, puoi essere certo che questi annunci
gestiti correttamente utilizzando i publisherId pubblicati se gli annunci vengono
disponibili.
Disponi di un tag annuncio video Ad Manager che posso utilizzare per i test?
I tag di esempio sono disponibili nella pagina dei tag di esempio.
Devo impostare adSlotWidth e adSlotHeight sullo stesso valore
come sz nel mio tag annuncio Ad Manager?
Non necessariamente. adSlotWidth e adSlotHeight
devono essere impostati sulla larghezza/altezza del player o dell'area su cui vuoi che vengano
riempire. Vengono utilizzati da AdSense per determinare quali annunci sono idonei
in quello spazio. La coppia chiave-valore sz nel tag annuncio Ad Manager è
un parametro di targeting e non influisce necessariamente sulla creatività pubblicata
(maggiori informazioni di seguito).
Il tag annuncio demo sembra fantastico, ma quando lo sostituisco con il mio tag annuncio, non viene visualizzato alcun annuncio.
Verifica che qualcosa venga trasferito al tag annuncio che stai
richiesta. Il modo più semplice per scoprirlo è controllare il traffico HTTP. Se
L'immagine grey.gif 1 x 1 pixel viene restituita all'interno di un blocco di ancoraggio HTML,
devi controllare il targeting in Ad Manager.
Voglio richiedere annunci utilizzando lo stesso tag più di una volta, ma ricevo annunci solo il primo
richiesta. Come faccio a risolvere il problema?
Se richiedi annunci più di una volta, devi informare l'ad server
che si tratti di richieste legittime e non di duplicati accidentali. L'SDK
lo fa per te con due rapide chiamate API:
Chiama destroy() sulla tua istanza AdsManager.
In questo modo impedisci la riproduzione dei post-roll quando effettui la chiamata riportata di seguito a
contentComplete(). Riceverai un nuovo AdsManager
quando effettuerai la prossima richiesta.
Chiama contentComplete() sul tuo AdsLoader
in esecuzione in un'istanza Compute Engine. Questa operazione reimposta l'SDK in modo che la nuova richiesta di annuncio non abbia l'aspetto di
un duplicato del precedente.
di Gemini Advanced.
Dopo aver effettuato le due chiamate precedenti, puoi chiamare requestAds()
l'istanza AdsLoader per visualizzare un altro insieme di annunci da riprodurre per il tuo
nuovo video.
Come faccio a richiedere annunci AdSense in overlay e a tutto spazio utilizzando l'SDK IMA?
Per richiedere annunci AdSense utilizzando l'SDK, devi prima ottenere un
tag annuncio. Puoi scoprire di più al riguardo nella pagina AdSense
per la pagina Video. Una volta ottenuto il tag, procedi nel seguente modo:
passaggi per effettuare una richiesta di annuncio in overlay o a tutto spazio:
Annunci in overlay.
In AdsRequest, imposta ViewModes su
NORMAL.
Nel tag annuncio, aggiungi il parametro overlay=1.
di Gemini Advanced.
Annunci a tutto spazio
In AdsRequest, imposta ViewModes su
FULLSCREEN.
Nel tag annuncio, aggiungi il parametro overlay=0.
Ricevo un "URL di clickthrough non valido" quando faccio clic sul mio annuncio. Quale potrebbe essere il motivo?
La causa più comune di questo errore è un clickthrough non corretto di escape
URL. Se viene visualizzato questo errore, verifica che il tuo clickthrough
L'URL contiene caratteri di escape corretti nella risposta VAST.
Perché viene visualizzato un messaggio "Documento VAST vuoto" errore?
Questo errore si verifica quando il tag annuncio restituisce un documento VAST vuoto, indicando
che l'annuncio non è stato pubblicato correttamente. Rivolgiti al tuo account manager
o un rappresentante dell'ad server per capire perché il tag annuncio non funziona.
Posso modificare le dimensioni e il testo della casella Salta annuncio o di altri elementi dell'interfaccia utente?
Gli SDK IMA non supportano la modifica del layout, delle dimensioni o dei contenuti degli elementi dell'interfaccia utente.
Per maggiori dettagli sugli elementi UI, consulta AdsManager.uiElements.
I controlli video nativi sono supportati con l'SDK HTML5?
No, l'SDK HTML5 non supporta i controlli nativi.
Ricevo il messaggio "Impossibile eseguire 'play'' su "HTMLMediaElement": l'API può essere avviata solo
con un gesto dell'utente". nella mia implementazione HTML5. Come faccio a risolvere il problema?
Sui dispositivi mobili, devi chiamare il numero adDisplayContainer.initialize()
in seguito a un'azione dell'utente (ad esempio un tocco). Se
Quando visualizzi questo errore, molto probabilmente lo stai chiamando in un contesto non avviato dall'utente. Tieni presente che
Deve essere il risultato diretto di un'azione utente. Ad esempio, se rispondi a un
"tocca" riproducendo un video, quindi utilizza il pulsante di riproduzione evento da chiamare
initialize(), l'SDK restituisce questo errore. Devi chiamare initialize() come
il risultato dell'evento di tocco.
Come faccio a gestire lo stato attivo della tastiera sui clic sugli annunci?
Se utilizzi i controlli da tastiera per il tuo player, potresti notare che non funzioneranno più
i seguenti clic sulla adDisplayContainer. Questo perché, una volta che un utente fa clic su un annuncio,
lo stato attivo della tastiera viene impostato sull'iframe IMA. Per mantenere lo stato attivo della tastiera sul player dei contenuti,
utilizza
CLICK
per trasferire nuovamente lo stato attivo della tastiera al contenitore desiderato. Vedi il seguente snippet di codice per
ulteriori dettagli:
adsManager.addEventListener(
google.ima.AdEvent.Type.CLICK,
function(){
window.focus();
// Or another method to return focus to the desired container.
});
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-05 UTC."],[[["\u003cp\u003eThe IMA HTML5 SDK facilitates ad integration and testing, but live ads depend on factors like ad targeting, formats, and publisher settings.\u003c/p\u003e\n"],["\u003cp\u003eIf your ad tag isn't working, review your Ad Manager targeting, ensure your descriptionUrl is properly set up, and check for any errors in your VAST response.\u003c/p\u003e\n"],["\u003cp\u003eFor repeated ad requests, use \u003ccode\u003edestroy()\u003c/code\u003e on the AdsManager and \u003ccode\u003econtentComplete()\u003c/code\u003e on the AdsLoader to avoid duplicate requests.\u003c/p\u003e\n"],["\u003cp\u003eNative video controls are not supported with the HTML5 SDK, and on mobile devices, \u003ccode\u003eadDisplayContainer.initialize()\u003c/code\u003e must be called directly as a result of a user action.\u003c/p\u003e\n"],["\u003cp\u003eKeyboard focus can be managed by utilizing the CLICK event and transferring it back to the content player.\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- [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- [Are native video controls supported with the HTML5 SDK?](#15)\n- [I'm seeing \"Failed to execute 'play' on 'HTMLMediaElement': API can only be\n initiated by a user gesture\" in my HTML5 implementation. How do I fix this?](#17)\n- [How do I handle keyboard focus on ad clicks?](#19)\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/html5/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\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\nAre native video controls supported with the HTML5 SDK?\n:\n No, the HTML5 SDK does not support native controls.\n\nI'm seeing \"Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated\nby a user gesture\" in my HTML5 implementation. How do I fix this?\n:\n On mobile devices, you must call `adDisplayContainer.initialize()`\n as the result of a user action (such as a tap). If you're\n seeing this error, you're most likely calling it on a non-user-initiated context. Note that it\n must be the **direct** result of a user action. For example, if you respond to a\n \"tap\" event by playing a video, and then use the video player's \"play\" event to call\n `initialize()`, the SDK returns this error. You must call `initialize()` as\n the result of the tap event itself.\n\nHow do I handle keyboard focus on ad clicks?\n:\n If you use keyboard controls for your player you may notice that they will no longer work\n following clicks on the `adDisplayContainer`. This is because, once an ad is clicked\n keyboard focus is switched to the IMA iframe. To keep keyboard focus on the content player, please\n utilize the\n [CLICK](/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdEvent)\n event to transfer keyboard focus back to the desired container. See the following code snippet for\n more details: \n\n ```text\n adsManager.addEventListener(\n google.ima.AdEvent.Type.CLICK,\n function(){\n window.focus();\n // Or another method to return focus to the desired container.\n });\n \n ```"]]