Using overlay with ad rules on
Google says that, with video ad rules active in the network or in the tag, non-linear ads are not eligible. The overlay simply does not appear.
Implementation guide
Overlay ads (non-linear ads)
A text or image ad that covers a part of the video while it keeps playing, without stopping the content.
Understand it in 1 minute
You know when you watch a game on TV and a small ad appears in a strip of the screen, but the game keeps going? The overlay ad is similar. It is a text or image ad that covers only a part of the video while it plays. The video does not stop: the person keeps watching, and the ad sits on top, like a sticker on a small piece of the screen.
In the world of video ads, this is called a non-linear ad. Linear is the ad that takes the place of the video, like the pre-roll, which stops the content. Non-linear is the one that shares the screen with the video. In Ad Manager, there is a creative type called Overlay, which Google describes as an ad that covers part of the video content while it plays. The ad can be text, image or both. You can upload the file to Ad Manager or use a remote file, and you can set the duration, scale and third-party tracking links.
On the site, the IMA SDK shows the overlay. It is Google's code package for ads in players. In the request, the player provides the width and height of the rectangular area where the non-linear ad can appear. Google says this size is required for non-linear ads and that it helps choose the ad, but it does not need to match its real size. When the ad loads and is not linear, Google's sample code keeps the video playing, so the ad sits on top of the moving content.
It has important rules. If video ad rules are active on the network or in the tag itself, overlay ads cannot be served. And, under Google's video policy, the video and ad controls cannot be covered, hidden or non-working. So the overlay must fit in the right area without covering the play, pause and volume buttons.
Step by step
Implemented example
<script>
var adsRequest = new google.ima.AdsRequest();
adsRequest.adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?' +
'iu=/1234567/exemplo&sz=640x480&env=vp&gdfp_req=1&output=vast' +
'&unviewed_position_start=1&vpa=click&vpmute=0&plcmt=1' +
'&description_url=https%3A%2F%2Fwww.exemplo.com%2Fvideo&correlator=';
// Área para anúncios lineares (que param o vídeo)
adsRequest.linearAdSlotWidth = 640;
adsRequest.linearAdSlotHeight = 400;
// Área para anúncios NÃO lineares (overlay), obrigatória para eles
adsRequest.nonLinearAdSlotWidth = 640;
adsRequest.nonLinearAdSlotHeight = 150;
adsLoader.requestAds(adsRequest);
// Quando o anúncio carrega: se não for linear, o vídeo segue tocando
function onAdLoaded(adEvent) {
var ad = adEvent.getAd();
if (!ad.isLinear()) {
video.play();
}
}
// adsManager.addEventListener(google.ima.AdEvent.Type.LOADED, onAdLoaded);
</script>What Google recommends
Tips
Watch out
Google says that, with video ad rules active in the network or in the tag, non-linear ads are not eligible. The overlay simply does not appear.
Without providing the width and height of the non-linear area in the request, IMA does not have the required criterion to choose this type of ad.
The overlay was made to appear while the video plays. Google's example tells the video to keep playing when the loaded ad is not linear.
If the overlay sits on top of the controls, the person cannot pause or change the volume, and that goes against Google's video policy.
No. It covers only a part of the video while the content keeps playing. Linear ads, like pre-roll, are the ones that stop the video.
No. With video ad rules active in the network or in the tag, overlay ads are not eligible.
Google's example uses 640 by 150. The value is used to choose the ad and does not need to match its real size.
Yes. Google says overlay ads can be text, image or both.
Library
Everything on this page follows Google's official documentation. Read it straight from the source:
The audit reads the site as a visitor would, without clicking anything, and shows what to fix.