Open workspace

Implementation guide

Audio ad

Audio ads (in-stream audio)

A sound-only ad that plays inside an audio player or a video player with sound, like radio commercials.

  • Ad Manager
  • Ad Exchange
  • AdSense (via Ad Manager)
  • inside an audio player or a video player with sound
Desktop
Mobile

Understand it in 1 minute

What an audio ad is

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

How to implement

  1. Create the audio ad unitWhen you create the ad unit, choose Audio as the main VAST size.
  2. Create the line item and creativesUse the type Audio and video with the expected creative size Audio. Add audio creatives, with or without redirect; without an audio creative, the line item does not deliver. Media files uploaded to Ad Manager must be at least 0.3 seconds long.
  3. Build the audio tagIn the tag, use ad_type=audio or audio_video, env=instream and vpmute=0. When the request is audio-only, the sz size is optional.
  4. Prepare the player with IMAUse an audio tag for the content and build the AdDisplayContainer with it. Keep the ad container hidden and create the pause, resume and volume buttons.
  5. Create the skip buttonIMA does not show a skip button for audio. At each ad progress update, check whether it can already be skipped and, on the click of your button, ask the AdsManager to skip.
  6. Add a companion bannerWhen an audio ad plays in a video player, Google strongly recommends showing a companion banner over the player, so it does not stay blank.

Implemented example

The code and how it looks on screen

It goes on the audio player page: the hidden ad container, the tag requesting audio with sound and a skip button made by the site itself.
<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>
On desktopThe person hears the ad in the audio or video player. The ad container stays hidden and, if there is a companion banner, it appears on the page.
On mobileSame as on desktop: the ad plays in the player with sound, with buttons created by the site, and the companion banner can appear along with it.

What Google recommends

Do and don't

Allowed

  • Request audio ads with ad_type=audio or mix audio and video with ad_type=audio_video.
  • Accept audio ads in videos with sound that can be followed by listening alone, such as news, sports, music and concerts.
  • Receive audio from Ad Exchange and AdSense, after linking the account to Ad Manager.
  • Use audio creatives, with or without redirect.
  • Create your own pause, resume, volume and skip buttons, since the ad container is hidden.

Not allowed

  • In In-stream spaces, audio ads cannot be requested or served in players without sound.
  • With ad_type=audio or audio_video, vpmute must be 0: the player cannot start muted.
  • An audio line item without audio creatives does not deliver ads.
  • Media files uploaded to Ad Manager cannot be shorter than 0.3 seconds.
  • Do not count on IMA to show a skip button for audio: it does not do that.

Tips

To do it right

Watch out

Common errors

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.

Forgetting to hide the ad container

IMA needs the AdDisplayContainer even for audio, but Google recommends keeping it hidden. After that, the controls must be created by the site.

Line item without an audio creative

Google warns that audio creatives must be added to the line item, otherwise it does not deliver.

Waiting for IMA's skip button

On audio ads, IMA does not show a skip button. Without your own button, the person cannot skip even when the ad allows it.

Frequently asked questions

Does it work for a podcast or audio show on my site?

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.

Can I play an audio ad inside a video?

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.

When is the impression counted?

Google says the impression counts when the player with IMA starts playing the ad.

Do I need to show an image?

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

Official Google source

Everything on this page follows Google's official documentation. Read it straight from the source:

Does your site use this format the right way?

The audit reads the site as a visitor would, without clicking anything, and shows what to fix.

Run an audit