Google IMA mode
The player runs in normal mode by default (standard VAST playback). If you want to play via the Google IMA SDK, set mode: "ima". It works the same way for both reward and outstream.
When to use it
- When you use ad tags or delivery that assume Google IMA
- When you want to align with the IMA SDK's tracking and measurement
For standard VAST delivery, leaving it as normal is fine.
Usage
Just pass mode: "ima". The IMA SDK is loaded automatically, so no additional script setup is required.
createRewardPlayer({
target: "reward-slot",
bid, // vastUrl (tag URL) or vastXml
mode: "ima",
});createOutstreamPlayer({
target: "feed-slot",
bid,
mode: "ima",
});Differences from normal
| normal | ima | |
|---|---|---|
| Playback | Standard VAST playback | Google IMA SDK |
| UI / design | Ad UI styled to the michao theme | Standard Google IMA UI |
| Skip | Player-controlled (skip policy) | IMA shows its own skip button per the tag's skipoffset |
| Measurement | OMID (optional) | The IMA SDK's own measurement |
How skip is handled
In ima mode, IMA shows the skip button, so a reward cannot fully enforce "watch to the end." The player accepts that skip and handles it according to policy.skip. If you need to require watching to completion, use normal.
IMA requires a Google Ad Manager ad tag
IMA requires a GAM video ad tag URL. Passing a raw bid (VAST) as-is does not work. For the concrete wiring with Prebid.js (generating a tag with buildVideoUrl and passing it to vastUrl), see Prebid.js integration.
For details on each option, see the API reference.