Conoce la arquitectura del SDK
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Selecciona la plataforma:
HTML5
Android
iOS
tvOS
En esta guía, se proporciona una descripción general del ciclo de vida del SDK y las interacciones entre tu reproductor de video, el SDK de IMA y un servidor de anuncios.
Interacciones básicas
En el siguiente diagrama, se ilustran y se anotan las interacciones entre tu reproductor de video, el SDK de IMA y un servidor de anuncios. El servidor de anuncios puede usar Ad Manager, AdSense para video (AFV) o Ad Exchange (AdX).

La página web o la aplicación cargan el SDK de IMA de la siguiente manera:
- una etiqueta de secuencia de comandos incorporada para HTML5
- Una app para Android, Google Cast, iOS o tvOS
El SDK de IMA solicita una respuesta de VAST para la unidad de anuncios específica en el servidor de anuncios. La URL de la etiqueta de anuncio determina el servidor de anuncios llamado, que puede ser Ad Manager en comparación con AFV o AdX.
El servidor de anuncios selecciona el mejor anuncio y envía una respuesta de VAST al SDK de IMA.
Los anuncios se seleccionan con uno de los siguientes métodos:
- Los filtros de bloques de anuncios de Ad Manager descartan los candidatos a líneas de pedido
- AdSense o Ad Exchange ejecutan una subasta
El SDK de IMA analiza la respuesta de VAST, determina el tipo de medio correcto según el entorno y publica la creatividad de video intercalada (y los anuncios complementarios, si es necesario) en la página web o la aplicación.
El reproductor de video negocia los detalles de reproducción con el SDK de IMA y reproduce los anuncios.
El SDK de IMA activa un ping de impresión y eventos de seguimiento de VAST, según sea necesario.
Lifecycle
En este diagrama, se muestra el ciclo de vida completo del SDK de IMA. Las llamadas a constructores y métodos se destacan en azul, los eventos en rojo y las condiciones de error se muestran con conectores y texto en rojo.
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-08-31 (UTC)
[null,null,["Última actualización: 2025-08-31 (UTC)"],[[["\u003cp\u003eThis guide explains the lifecycle of the Interactive Media Ads (IMA) SDK and how it facilitates communication between your video player, the SDK, and an ad server (Ad Manager, AdSense for Video, or Ad Exchange).\u003c/p\u003e\n"],["\u003cp\u003eThe process involves the IMA SDK requesting ads from the ad server based on the provided ad tag URL, the ad server selecting and sending a VAST response, and the SDK parsing this response to deliver ads to the video player.\u003c/p\u003e\n"],["\u003cp\u003eThe video player then handles ad playback while the IMA SDK manages tracking events like impressions and VAST events for reporting purposes.\u003c/p\u003e\n"],["\u003cp\u003eThis guide also visually illustrates the entire IMA SDK lifecycle including constructor calls, method calls, events, and potential errors.\u003c/p\u003e\n"]]],[],null,["Select platform: [HTML5](/interactive-media-ads/docs/sdks/html5/client-side/architecture \"View this page for the HTML5 platform docs.\") [Android](/interactive-media-ads/docs/sdks/android/client-side/architecture \"View this page for the Android platform docs.\") [iOS](/interactive-media-ads/docs/sdks/ios/client-side/architecture \"View this page for the iOS platform docs.\") [tvOS](/interactive-media-ads/docs/sdks/tvos/client-side/architecture \"View this page for the tvOS platform docs.\")\n\n\u003cbr /\u003e\n\nThis guide provides an overview of the SDK lifecycle and the interactions\nbetween your video player, the IMA SDK, and an ad server.\n\nBasic interactions\n\nThe following diagram illustrates and annotates the interactions between\nyour video player, the IMA SDK, and an ad server. The ad server can use\nAd Manager, AdSense for Video (AFV), or Ad Exchange (AdX).\n\n1. The web page or app loads the IMA SDK using:\n\n - an embedded script tag for HTML5\n - an app for Android, Google Cast, iOS, or tvOS\n2. The IMA SDK requests a VAST Response for the specific Ad Unit on the ad\n server. The ad server called, which can be either Ad Manager versus AFV or\n AdX, is determined by the ad tag URL.\n\n3. The ad server selects the best ad and sends a VAST response to the IMA SDK.\n Ads are selected using one of the following methods:\n\n - Ad Manager Ad Unit filters Line Item candidates\n - AdSense or Ad Exchange runs an auction\n4. The IMA SDK parses the VAST response, determines the correct media type based\n on environment, and delivers the inline video creative (and\n companion ads if needed) to the web page or app.\n\n5. The video player negotiates the playback details with the IMA SDK and plays\n the ads.\n\n6. The IMA SDK fires an impression ping and VAST tracking events, as needed.\n\nLifecycle\n\nThis diagram shows the full lifecycle of the IMA SDK. Constructor and method\ncalls are highlighted in blue, events are highlighted in red, and error\nconditions are shown with red connectors and red text."]]