VAST Ad Code

🚧

Caution

To serve VAST ads, please contact your account manager.

Overview

At this time, you must generate VAST ad code yourself. VAST ad tags are in the format of a URL that will be called by a video player.

Generating the Request Object

To construct the code, you must generate a JSON request object that contains one or more placements.

Request:

KeyRequired?Description
pyesArray of one or more Placement objects (see below)
ukeynoA UserDB user key
ipnoAn IP address (overrides the remote IP of the request)
refnoA referrer URL (overrides the Referer header of the request)
urlnoThe URL to use as the current page URL when selecting an ad
tnoThe UNIX epoch timestamp to use when selecting an ad
kwnoKeywords for the request
ntnoDo Not Track. If set to 1, DNT is enabled
bnoA list of blocked items
bfnoBot Filtering. If set to 1, bot filtering is enabled

Placement:

PropertyRequired?Decision
tyesAn adType ID, or an array of adType IDs
nyesThe numeric network id to use when selecting an ad
syesThe numeric site id to use when selecting an ad
znoZero or more zone ids to use when selecting an ad
cnoA numeric campaign id; if specified, only consider ads in that campaign
fnoA numeric flight id; if specified, only consider ads in that flight
anoA numeric ad (flight-creative map) id; if specified, only serve that ad if possible
unoA URL that should be used as the click-through target for the ad
pnoA hash of key/value pairs used for Custom Targeting
cknoA hash of key/value pairs used with ContentDB

An example of a constructed request object with one placement:

{"p":[{"n":1234,"t":1234,"s":123456}]}

Generating the VAST URL

Once you have a request object, you can generate the URL by urlencoding the request object and passing it to the VAST endpoint http://e-<networkId>.adzerk.net/vast3 using the querystring ?r=.

For example,

{"p":[{"n":1234,"t":1234,"s":123456}]}

Is urlencoded as:

%7B%22p%22%3A%5B%7B%22n%22%3A1234%2C%22t%22%3A1234%2C%22s%22%3A123456%7D%5D%7D%0A

The URL of the ad code becomes:

https://e-1234.adzerk.net/vast3?r=%7B%22p%22%3A%5B%7B%22n%22%3A1234%2C%22t%22%3A1234%2C%22s%22%3A123456%7D%5D%7D%0A