Requesting audio with the player muted
Google's policy prohibits requesting or serving audio ads in In-stream spaces without sound. Check that the player has sound and that vpmute=0.
Implementation guide
Audio ads (in-stream audio)
A sound-only ad that plays inside an audio player or a video player with sound, like radio commercials.
Understand it in 1 minute
You know radio commercials, when the music stops and someone talks about a store? The audio ad is that on your site. It is a sound-only ad that plays inside a player, the same way video ads do, but without an image. It suits content that people listen to, such as music, talk shows and videos you can follow by listening alone.
In Ad Manager, setting up audio is similar to video. You create an ad unit with Audio as the main VAST size, use line items of the type Audio and video with the creative size Audio, and add audio creatives. Google also says that sites with videos that can be only listened to, like news, sports, music and concerts, can accept audio ads in videos with sound. To receive audio from Ad Exchange and AdSense, the account must be linked to Ad Manager.
On the site side, the IMA SDK plays the ad. It is Google's code package for ads in players. For audio-only content, Google recommends using an audio tag to build the AdDisplayContainer. Even without an image, IMA still needs this container, and Google recommends keeping it hidden. Since the container is hidden, the site needs to create its own pause, resume and volume buttons. The ad tag must say it wants audio (ad_type equal to audio or audio_video), that the request is In-stream (env equal to instream) and that the player has sound on (vpmute equal to 0).
Why so much care with sound? Because Google's video policy says that, in In-stream spaces, audio ads cannot be requested or served in players without sound. It makes sense: a sound ad in a muted player would be like a radio that is turned off. It is also worth knowing that IMA does not show a skip button on audio ads, so the site needs to build its own. And, when the video player can receive audio ads, Google strongly recommends adding a companion banner, so the player does not stay blank.
Step by step
Implemented example
<style>
/* a caixa do anúncio fica escondida */
.ad-container { display: none; }
</style>
<audio id="audio-player" src="meu-programa.mp3"></audio>
<div class="ad-container"></div>
<button id="pular" hidden>Pular anúncio</button>
<script src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
<script>
var audio = document.getElementById('audio-player');
var adDisplayContainer = new google.ima.AdDisplayContainer(
document.querySelector('.ad-container'), audio);
var adsLoader = new google.ima.AdsLoader(adDisplayContainer);
var adsManager;
var adsRequest = new google.ima.AdsRequest();
adsRequest.adTagUrl = 'https://pubads.g.doubleclick.net/gampad/ads?' +
'iu=/1234567/exemplo&ad_type=audio&env=instream&vpmute=0' +
'&gdfp_req=1&output=vast&unviewed_position_start=1' +
'&description_url=https%3A%2F%2Fwww.exemplo.com%2Faudio&correlator=';
adsLoader.requestAds(adsRequest);
adsLoader.addEventListener(
google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
function (e) {
adsManager = e.getAdsManager(audio);
// O IMA não mostra botão de pular em áudio: o site cria o seu
adsManager.addEventListener(google.ima.AdEvent.Type.AD_PROGRESS,
function () {
document.getElementById('pular').hidden =
!adsManager.getAdSkippableState();
});
});
document.getElementById('pular').addEventListener('click', function () {
adsManager.skip();
});
</script>What Google recommends
Tips
Watch out
Google's policy prohibits requesting or serving audio ads in In-stream spaces without sound. Check that the player has sound and that vpmute=0.
IMA needs the AdDisplayContainer even for audio, but Google recommends keeping it hidden. After that, the controls must be created by the site.
Google warns that audio creatives must be added to the line item, otherwise it does not deliver.
On audio ads, IMA does not show a skip button. Without your own button, the person cannot skip even when the ad allows it.
It does if the audio plays in a page player with IMA. Google has its own guide for requesting ads on audio-only content, using the HTML audio tag.
You can, in videos with sound. Use ad_type=audio_video and env=instream in the tag and accept the Audio size in the line items.
Google says the impression counts when the player with IMA starts playing the ad.
It is not required, but in video players that can receive audio ads, Google strongly recommends using companion banners, so the player does not stay blank.
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.