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 outlines the lifecycle of the Interactive Media Ads (IMA) SDK and how it interacts with your video player and an ad server (Ad Manager, AdSense for Video, or Ad Exchange).\u003c/p\u003e\n"],["\u003cp\u003eThe process involves the IMA SDK requesting and parsing ad responses, delivering ads to the player, and managing playback and tracking events.\u003c/p\u003e\n"],["\u003cp\u003eAd selection is handled either through Ad Manager's Ad Unit filters or via auctions in AdSense or Ad Exchange.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers integrate the IMA SDK using script tags for HTML5 or dedicated apps for various platforms including Android, iOS, and tvOS.\u003c/p\u003e\n"],["\u003cp\u003eThe guide also highlights potential error conditions within the SDK lifecycle.\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."]]