ima-sdk-client-side

Integrates Google IMA SDK for client-side video ad insertion across web, Android, iOS, and tvOS.

19.1k|1.5k|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/google/skills --skill ima-sdk-client-side
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ima-sdk-client-side
Source: https://github.com/google/skills/tree/main/skills/ads/ima-sdk-client-side
Command: npx skills add https://github.com/google/skills --skill ima-sdk-client-side

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Integrating the Google Interactive Media Ads (IMA) SDK for client-side ad insertion involves platform-specific lifecycle steps, event handling, and cleanup rules that are easy to get wrong, causing memory leaks, playback bugs, and failed ad requests.

Core Features & Use Cases

  • Platform-specific integration guides: Step-by-step references for HTML5/Web (including iframe mode and mobile Safari), Android, iOS, and tvOS covering initialization, ad requests, playback events, and cleanup.
  • Lifecycle best practices: Enforces early SDK initialization, user-gesture compliance, autoplay fallback handling, and proper AdsManager/AdsLoader destruction to prevent memory leaks.
  • Use Case: You are building a React web app that needs to play VAST video ads before content. The skill walks you through loading the SDK, configuring settings, handling autoplay policies, and cleaning up the AdsManager on unmount.

Quick Start

Use the ima-sdk-client-side skill to integrate client-side video ads into my Android app using a VAST ad tag URL.

Frequently Asked Questions about ima-sdk-client-side

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate Google IMA SDK for client-side video ads?

Follow the six-step lifecycle: import the SDK, initialize settings and the AdsLoader early, create an ad request with your VAST ad tag URL, handle load success to get the AdsManager, listen for playback events to pause and resume content, and destroy the AdsManager during cleanup.

How to play VAST ads in an Android app with IMA SDK?

Add the com.google.ads.interactivemedia.v3:interactivemedia dependency with minSdk 23, initialize the SDK in Application.onCreate, create an AdsLoader with an AdDisplayContainer, and call requestAds before content playback. Always call AdsManager.destroy() on completion or errors.

Does the IMA SDK support autoplay video ads on web?

Yes, but you must detect browser autoplay support and fall back from unmuted autoplay to muted autoplay, then to a user gesture. Inform the SDK using setAdWillAutoPlay() and setAdWillPlayMuted() so the ad server returns a compatible ad.

Can I use the IMA HTML5 SDK inside a cross-origin iframe?

Prefer loading the SDK at the top page level. If stuck in a cross-origin iframe, set adsRequest.pageUrl to the parent page URL and ensure the iframe sandbox includes allow-scripts, allow-same-origin, allow-popups, and related flags.

When should I not use the IMA client-side SDK?

Do not use this skill for Dynamic Ad Insertion (DAI), server-side ad insertion (SSAI), or server-guided ad insertion (SGAI). It only covers client-side ad requests for VAST or VMAP compliant ad servers.

Why does my IMA SDK integration leak memory or keep playing audio?

This happens when AdsManager.destroy() is not called after ads complete, on fatal errors, or when the user navigates away. Also remove event listeners and release the AdsLoader when permanently tearing down the player.