VAST and VPAID

Learn how to leverage our API to integrate online video ads using the following standards:

View IAB's standards, guidelines, and best practices for:

Custom VAST Extensions

The response from an ad server may contain custom VAST extensions. These custom VAST extensions are included in the response provided for:

Extensions Array

An ad server provides custom VAST extensions in XML format. The rules through which this XML content is converted to JSON are explained below.

Example

A sample XML response from an ad server is provided below.

<Extensions>
	<Extension fallback_index="0" type="waterfall" />
	<Extension type="geo">
		<Country>US</Country>
		<Bandwidth>0</Bandwidth>
	</Extension>
	<Extension type="activeview">
		<CustomTracking>
			<Tracking event="viewable_impression">https://pubads.g.doubleclick.net/pagead/conversion/?ai=BYW1B...AHHw&sigh=qtzpMUZ5DzM&label=viewable_impression&acvw=[VIEWABILITY]&gv=[GOOGLE_VIEWABILITY]&ad_mt=[AD_MT]</Tracking>
			<Tracking event="abandon">https://pubads.g.doubleclick.net/pagead/conversion/?ai=BYW1B...AHHw&sigh=qtzpMUZ5DzM&label=video_abandon&acvw=[VIEWABILITY]&gv=[GOOGLE_VIEWABILITY]</Tracking>
		</CustomTracking>
	</Extension>
	<Extension type="metrics">
		<FeEventId>8_zT4LjWGM7gpAOa7p8Q</FeEventId>
		<AdEventId>CIDG5POK7dICFReRaQodN-kNMw</AdEventId>
	</Extension>
</Extensions>

The above custom VAST extensions will be included in the Preplay and Ping responses under the extensions array as indicated below.

...
		"extensions":[  
                     {  
                        "waterfall":[  
                           {  
                              "fallback_index":"0"
                           }
                        ]
                     },
                     {  
                        "geo":[  
                           {  
                              "Country":"US"
                           },
                           {  
                              "Bandwidth":"0"
                           }
                        ]
                     },
                     {  
                        "activeview":[  
                           {  
                              "CustomTracking":[  
                                 {  
                                    "Tracking":"https://pubads.g.doubleclick.net/pagead/conversion/?ai=BpL3zK...AYRAB&sigh;=edOT3dMFSbQ&label;=viewable_impression&acvw;=[VIEWABILITY]&gv;=[GOOGLE_VIEWABILITY]&ad;_mt=[AD_MT]",
                                    "event":"viewable_impression"
                                 },
                                 {  
                                    "Tracking":"https://pubads.g.doubleclick.net/pagead/conversion/?ai=BpL3zK...AYRAB&sigh;=edOT3dMFSbQ&label;=video_abandon&acvw;=[VIEWABILITY]&gv;=[GOOGLE_VIEWABILITY]",
                                    "event":"abandon"
                                 }
                              ]
                           }
                        ]
                     },
                     {  
                        "metrics":[  
                           {  
                              "FeEventId":"KSL1WK-fN4X6vgKH4pnoBQ"
                           },
                           {  
                              "AdEventId":"CO-FsISnrNMCFVWxTwodkIgH_Q"
                           }
                        ]
                     }
                  ],
...

VPAID

Information that facilitates the interaction between a video player and a VPAID ad unit is included in the response provided for:

The ad break portion of the response for both of these methods is identical and information on it may be found in the Preplay API article.

Basic Setup

Perform the following steps:

  1. Set up the player to perform the following tasks whenever it encounters a VPAID ad unit:

    • Display the ad.
    • Fire ad-related events.
    • Send beaconing data by leveraging the event data provided in the events object.

      Server-side beaconing will not be triggered for VPAID (Video Player-Ad Interface Definition) ad units.

  2. Live/Linear Streaming Only: Enable the Ad Impressions and the Linear Ad Data features on a per session basis by setting the pingf parameter to 5.

Live/Linear Streaming

Ad slate will be inserted into a live/linear stream for the duration of each VPAID ad. By default, this allows the live/linear stream to resume immediately after the completion of the VPAID ad. However, users that interact with a VPAID ad unit may cause the ad to exceed this duration. It is important to set up your video player to handle this type of situation.

Common methods for handling this situation are:

Reduce bandwidth usage by setting up the video player to switch to a lower ray during a VPAID ad.

On-Demand Streaming

On-demand content will contain a placeholder ad for each VPAID ad unit. This placeholder ad consists of two seconds of black frames. A video player should be configured to pause playback upon detecting these black frames and resume playback once the user's interaction with the VPAID ad unit has completed.

Sample API Response

VPAID information is reported in the exact same manner for both the Ping and Preplay methods.

Learn more about the ads object.

Sample response:

...
	"ads": {
		"breaks": [{
				"breakId": "0.0.0.1234567890",
				"ads": [{
						"mimeType": "application/javascript",
						"apiFramework": "VPAID",
						"companions": [],
						"creative": "https://.../ad/.../vpaid.js",
						"width": 640,
						"duration": 15,
						"height": 480,
						"events": {
							"firstquartiles": [
								"http://account.v.fwmrm.net/ad/1/1?..."
							],
							"clicktrackings": [
								"http://account.v.fwmrm.net/ad/1/1?..."
							],
							"GENERIC": "http://account.v.fwmrm.net/ad/1/1?...",
							"midpoints": [
								"http://account.v.fwmrm.net/ad/1/1?..."
							],
							"thirdquartiles": [
								"http://account.v.fwmrm.net/ad/1/1?..."
							],
							"impressions": [
								"http://account.v.fwmrm.net/ad/1/1?..."
							],
							"completes": [
								"http://account.v.fwmrm.net/ad/1/1?..."
							]
						}
					}
				],
				"duration": 15,
				"height": 0,
				"width": 0,
				"timeOffset": 0,
				"position": "preroll",
				"type": "linear",
				"events": {
					"impressions": [
						"http://account.v.fwmrm.net/ad/1/1?..."
					]
				}
			}, {
...