Displaying VAST+VPAID Companions

There are three ways for displaying companion ads when using VAST + VPAID ad tags. The first option is the default and does not require any additional changes.

  1. Dummy Div

    By default, Video SSP's VAST+VPAID ad tag will return an HTMLResource for the companion. The code contains a div that serves the purpose of providing a known location on the page for Video SSP's VPAID unit to inject the companion ad into. The expectation is that the VAST player receives the initial VAST+VPAID response, identifies the companion spots it supports, and embeds those companion divs into the publisher's site. By default, the dummy div is hidden on the page until Video SSP's VPAID unit determines the final companion and injects its contents into the available dummy divs.

  2. companionId in ad tag

    To make use of an existing companion container div on the publisher's site that is already used for companion banners, the parameter companionId can be appended to the ad tag with the value of the existing div id. The VAST response will no longer contain a CompanionAds section referenced in #1 above, and the Video SSP VPAID unit will inject the companion into the div with the provided id.

  3. Custom VPAID Event

    If injectCompanionDummy=false is appended to the ad tag, the VAST response will no longer contain a CompanionAds section. Instead, our VPAID unit will fire the AdLoadCompanion custom VPAID Event. This API is tied to the VAST 1 spec. The event contains an XMLList that conforms to the VAST 1 Companion element.

    <Companion width={width} height={height} resourceType={resourceType}>
    <URL>{creativeUrl}</URL>
    </Companion>

    The data can be accessed using:

    var companionXml:XMLList = e.data;
    var item:XML;
    for each (item in companionXml) {
    // Just an example of what you'll find:
    trace(item.Companion@resourceType); // might print "iframe", for example
    }

Ensure to listen for the "AdLoadCompanion" event which will contain these properties below:

  • width
  • height
  • creativeUrl
  • resourceType
Have more questions? Submit a request