IMA for HTML5 Games (e.g. Unity3D WebGL builds)

3,471 views
Skip to first unread message

wil...@wearetrail.com

unread,
Jul 17, 2016, 7:25:52 PM7/17/16
to Interactive Media Ads SDK
Hello,

Is there any way to display ads in a HTML5 game (specifically Unity3D's WebGL export)? Imagine the game running in a (HTML5) fullscreen canvas. Furthermore the mouse cursor is locked (HTML5 pointer lock). This is very much like a video playing in fullscreen.

I read this post which makes it sound as if the IMA HTML5 SDK should be used with HTML5 games. But the documentation for this SDK only mentions video. Which is the correct way to display ads in a 100% canvas HTML5 game?

Vu Chau (IMA SDK Team)

unread,
Jul 18, 2016, 11:08:36 AM7/18/16
to Interactive Media Ads SDK
Hi Willem,

IMA supports both video-based and game-based advertisement.  Since the majority of use cases we support is around video environments, that is why most of the docs are geared in that direction.

So to get started with integrating the HTML5 SDK into your games, you would need to sign up for AdSense for Games.  Once done, you will get an ad tag that you will use to plug into the SDK to serve ads.  Let us know if you any questions regarding ad tags, VAST, et al. 

The way the HTML5 SDK works is that we layer our own ad player on top of your content player, so that when the ad plays, the content can start buffering.  That is a great advantage, but since there essentially would be no content video, you can leave out any code in our samples having to do with the content video player.  

You can have your code on the same page as your game.  Once the ad is over (detectable via the COMPLETE event for a single ad, or ALL_ADS_COMPLETED for an ad playlist), call .destroy() on the AdsManager to remove it from the page, and start your game logic.  Or, you can have the ad serving code on its own page, and once one of the aforementioned ad events gets called, redirect the user to your game page. 

The SDK supports simulated full screen, if that matters to your game implementation.  See our live example for a demo of how it looks and behaves.

Let us know if you have any questions,

Vu Chau
IMA SDK Team

Willem Demmers

unread,
Jul 19, 2016, 9:31:40 AM7/19/16
to ima...@googlegroups.com
Hello Vu,

Thanks for your swift yet thorough reply. I appreciate it.

So this means that it’s in accordance with AdSense policies to advertise with the HTML IMA SDK for HTML5 games then?

You’re speaking mainly of full screen video ads? Is it possible to have banners (overlay ads with pictures) as well or is that out of the question?

Our idea is to have a full screen game with the pointer locked (and thus invisible). We would like to show ads in between matches (on the score screen) and remove the ads when the user presses “play again” or similar. We would like to place these overlay ads on top of our HTML5 canvas that is run in full screen.

Do you think this is possible? Can it be done with DoubleClick otherwise?

Thanks
Willem Demmers

Vu Chau (IMA SDK Team)

unread,
Jul 19, 2016, 12:44:19 PM7/19/16
to Interactive Media Ads SDK
Hi Willem,

I'm going to address your points one by one, as follows:
So this means that it’s in accordance with AdSense policies to advertise with the HTML IMA SDK for HTML5 games then?
That is correct.  In fact, game implementations that use the IMA SDK for advertising needs are to use AdSense as the ad server.
You’re speaking mainly of full screen video ads? Is it possible to have banners (overlay ads with pictures) as well or is that out of the question?
The closest thing to an overlay ad that AdSense provides is a full-slot ad (fig. 3). These ads are linear, so they interrupt the game progress.  As explained on that page, full-slot ads are ideal for when the game loads, between game levels, or at the end of the game.
Our idea is to have a full screen game with the pointer locked (and thus invisible). We would like to show ads in between matches (on the score screen) and remove the ads when the user presses “play again” or similar. We would like to place these overlay ads on top of our HTML5 canvas that is run in full screen.
Let us know if full-slot ads work for you.  These either time out and collapse after 15 seconds, or once manually dismissed by the user.   You could use z-index here to layer the AdsManager and your HTML5 canvas if needed.

There is a forum for AdSense product questions, and an FAQ for general AdSense-based implementations, so also be sure to check them out!

Vu Chau
IMA SDK Team

Willem Demmers

unread,
Jul 19, 2016, 1:03:40 PM7/19/16
to ima...@googlegroups.com
Hi Vu,

Thanks for your response. See my answer inline below:
I'm going to address your points one by one, as follows:
So this means that it’s in accordance with AdSense policies to advertise with the HTML IMA SDK for HTML5 games then?
That is correct.  In fact, game implementations that use the IMA SDK for advertising needs are to use AdSense as the ad server.
Ok. So IMA SDK is not to be used with DFP (DoubleClick for Publishers)?
By the way, under requirements it says:

"Utilize a Flash-based AS3 game launcher: AdSense for games is only available for Flash-based game content.

But this is untrue? It is also available for HTML5 based content?
You’re speaking mainly of full screen video ads? Is it possible to have banners (overlay ads with pictures) as well or is that out of the question?
The closest thing to an overlay ad that AdSense provides is a full-slot ad (fig. 3). These ads are linear, so they interrupt the game progress.  As explained on that page, full-slot ads are ideal for when the game loads, between game levels, or at the end of the game.
That's too bad. I was hoping there was a partial ad that could be shown on a part of the screen while the game was not interrupted. See diep.io for reference. They show a single square ad at the bottom of the screen at the start of a match and every time a player dies in the game, until the player selects play again.
Our idea is to have a full screen game with the pointer locked (and thus invisible). We would like to show ads in between matches (on the score screen) and remove the ads when the user presses “play again” or similar. We would like to place these overlay ads on top of our HTML5 canvas that is run in full screen.
Let us know if full-slot ads work for you.  These either time out and collapse after 15 seconds, or once manually dismissed by the user.   You could use z-index here to layer the AdsManager and your HTML5 canvas if needed.
Preferably I would really like something that doesn’t interrupt the UI of our canvas. Do you know if it’s possible to serve AdSense ads in a different format via Google DoubleClick?

There is a forum for AdSense product questions, and an FAQ for general AdSense-based implementations, so also be sure to check them out!
Thanks for the help and resources. It’s like a jungle trying to navigate the ad-space. 

Vu Chau
IMA SDK Team

On Tuesday, July 19, 2016 at 9:31:40 AM UTC-4, Willem Demmers wrote:
Hello Vu,

Thanks for your swift yet thorough reply. I appreciate it.

So this means that it’s in accordance with AdSense policies to advertise with the HTML IMA SDK for HTML5 games then?

You’re speaking mainly of full screen video ads? Is it possible to have banners (overlay ads with pictures) as well or is that out of the question?

Our idea is to have a full screen game with the pointer locked (and thus invisible). We would like to show ads in between matches (on the score screen) and remove the ads when the user presses “play again” or similar. We would like to place these overlay ads on top of our HTML5 canvas that is run in full screen.

Do you think this is possible? Can it be done with DoubleClick otherwise?

Thanks
Willem Demmers

On Monday 18 July 2016 at 17:08, 'Vu Chau (IMA SDK Team)' via Interactive Media Ads SDK wrote:

Hi Willem,

IMA supports both video-based and game-based advertisement.  Since the majority of use cases we support is around video environments, that is why most of the docs are geared in that direction.

So to get started with integrating the HTML5 SDK into your games, you would need to sign up for AdSense for Games.  Once done, you will get an ad tag that you will use to plug into the SDK to serve ads.  Let us know if you any questions regarding ad tags, VAST, et al. 

The way the HTML5 SDK works is that we layer our own ad player on top of your content player, so that when the ad plays, the content can start buffering.  That is a great advantage, but since there essentially would be no content video, you can leave out any code in our samples having to do with the content video player.  

You can have your code on the same page as your game.  Once the ad is over (detectable via the COMPLETE event for a single ad, or ALL_ADS_COMPLETED for an ad playlist), call .destroy() on the AdsManager to remove it from the page, and start your game logic.  Or, you can have the ad serving code on its own page, and once one of the aforementioned ad events gets called, redirect the user to your game page. 

The SDK supports simulated full screen, if that matters to your game implementation.  See our live example for a demo of how it looks and behaves.

Let us know if you have any questions,

Vu Chau
IMA SDK Team

--
You received this message because you are subscribed to a topic in the Google Groups "Interactive Media Ads SDK" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ima-sdk/93yqQHnYC94/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ima-sdk+u...@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/ima-sdk.
For more options, visit https://groups.google.com/d/optout.

Vu Chau (IMA SDK Team)

unread,
Jul 19, 2016, 5:02:56 PM7/19/16
to Interactive Media Ads SDK
Hi Willem,

Thanks for the elaboration.

You can certainly use AFG with the HTML5 IMA SDK.  We have a wizard here that walks you through your use cases and presents recommendations.  I have prefilled the options to show that HTML5 games are also supported.  This is the approval form for once you are ready to submit your implementation for an approval check.

IMA can also be used with DFP.  In fact that's the majority of the use cases we have been supporting.  I'm not sure of its role in games, however (our expertise is with the SDK itself).  
By "interrupt", I mean the ad would halt the progress of the game (i.e. game started --> ad / game paused --> ad over / game resumed).  To show an ad, the SDK will overlay our ad interface for the duration of the ad, and remove it once done.  That shouldn't interrupt the UI of your game.

DFP has non-linear overlay ads (https://goo.gl/Z4AwZq - hit Test Ad) but then from the SDK's standpoint, I wouldn't be able to comment on whether that is allowed for game implementations.  If you have an account manager, they should be able to provide a confirmation on that.

It doesn't look like diep.io uses IMA on that page.  I did a quick search for "ima3.js" (HTML5) or IMA's "swf" (Flash) resources in the network traffic but couldn't see any reference.

Vu Chau
IMA SDK Team

sofim...@gmail.com

unread,
Aug 8, 2016, 1:19:09 PM8/8/16
to Interactive Media Ads SDK
Hi Vu,

I sent an approval request for my game, but I used AFV ima url instead of AFG one, as the former has controls for volume, play/pause, and skip, while the latter doesn't has any of them, and doesn't even stop when the user clicks the ad. Am I going to be rejected? Slither.io has AdSense ima ads, but they have all those controls, just like AFV.

Vu Chau (IMA SDK Team)

unread,
Aug 8, 2016, 5:03:28 PM8/8/16
to Interactive Media Ads SDK
Hi there,
[...] and doesn't even stop when the user clicks the ad
Could you elaborate on this?  If you would like the ad to stop, you can call adsManager.pause() for pause, or adsManager.skip() to skip the ad (if it is skippable).  If you have a live page, I can look into it.
 Am I going to be rejected?
You would have to check directly with AdSense about that, since our expertise is only with the SDK and not AdSense.

Let me know if you need anything else,

Vu Chau
IMA SDK Team

vivek chakraverty

unread,
Aug 27, 2016, 7:54:54 AM8/27/16
to Interactive Media Ads SDK
Hi Everyone,

I am a newbie unity game developer and seek to integrate fullscreen video ads with my unity webgl build. I want the ads to occur only at particular places in the game. Also, the game is for children aged 8-10 so the content of the ads should be appropriate. Can you provide me with a step by step guide to get my ads up and running?

Vu Chau (IMA SDK Team)

unread,
Aug 29, 2016, 10:38:06 AM8/29/16
to Interactive Media Ads SDK
Hi Vivek,

IMA currently doesn't support Unity builds.  You might be interested in using the Mobile Ads SDK instead, since it has a plugin for Unity.  Rewarded video ads sounds like what you are interested in.

Vu Chau
IMA SDK Team

Tim Holmgren

unread,
Jun 23, 2017, 12:49:51 PM6/23/17
to Interactive Media Ads SDK
Hi Vu,

Just wanted to follow up on this older post (all links seem to point here on this subject).... Is it possible to add Unity WebGL ads using the IMA SDK  (e.g. is there a Unity SDK available or planned)?  If so, is there any documentation we can review?  

You mention the Unity Google Mobile Ads SDK but it only seems to support native Android and iOS.

Google Mobile Ads SDK.


"The Google Mobile Ads SDK is the latest generation in Google mobile advertising featuring refined ad formats and streamlined APIs for access to mobile ad networks and advertising solutions. The SDK enables mobile app developers to maximize their monetization in native mobile apps.

This repository contains the source code for the Google Mobile Ads Unity plugin. This plugin enables Unity developers to easily serve Google Mobile Ads on Android and iOS apps without having to write Java or Objective-C code. The plugin provides a C# interface for requesting ads that is used by C# scripts in your Unity project."


Thanks,
Tim

Chris Feldman (IMA SDK Team)

unread,
Jun 23, 2017, 3:18:46 PM6/23/17
to Interactive Media Ads SDK
Hi Tim,

At this time, the IMA SDK does not support Unity WebGL. However, there's no reason that you shouldn't be able to run the HTML5 version of the SDK alongside a Unity WebGL build. You just couldn't run the SDK through Unity directly, it would need to be separate.

Let me know if you continue to have issues.

Regards,
Chris Feldman
IMA SDK Team

Tim Holmgren

unread,
Aug 8, 2017, 10:16:29 AM8/8/17
to Interactive Media Ads SDK
I'll post to public incase other people are interested... are we allowed to use the IMA SDK for reward videos too?  
I see it's available for Admob... 


Is this allowed?  

E.g. For a game.... Get an Extra Life option > Watch Video > Reward Extra Life once video completes

Thanks,
Tim

On Sunday, July 17, 2016 at 7:25:52 PM UTC-4, wil...@wearetrail.com wrote:

Chris Feldman (IMA SDK Team)

unread,
Aug 8, 2017, 11:42:20 AM8/8/17
to Interactive Media Ads SDK
Hi Tim,

I'm only able to provide support for technical issues on this forum. For policy and other account related questions, you can reach out to Publisher Support. Our ad serving guidelines are also available on this page.

Regards,
Chris Feldman
IMA SDK Team

Reply all
Reply to author
Forward
0 new messages