VAST Ad Code
CautionTo serve VAST ads, please contact your account manager.
Overview
A VAST ad tag takes the form of a URL that your video player calls. At this time, you must generate that URL yourself.
Generating the Request Object
To construct the URL, you first build a JSON request object containing one or more placements.
Request:
| Key | Required? | Description |
|---|---|---|
p | yes | Array of one or more Placement objects (see below) |
ukey | no | A UserDB user key |
ip | no | An IP address (overrides the remote IP of the request) |
ref | no | A referrer URL (overrides the Referer header of the request) |
url | no | The URL to use as the current page URL when selecting an ad |
t | no | The UNIX epoch timestamp to use when selecting an ad |
kw | no | Keywords for the request |
nt | no | Do Not Track. If set to 1, DNT is enabled |
b | no | A list of blocked items |
bf | no | Bot Filtering. If set to 1, bot filtering is enabled |
Placement:
| Property | Required? | Description |
|---|---|---|
t | yes | An adType ID, or an array of adType IDs |
n | yes | The numeric network ID to use when selecting an ad |
s | yes | The numeric site ID to use when selecting an ad |
z | no | Zero or more zone IDs to use when selecting an ad |
c | no | A numeric campaign ID; if specified, only consider ads in that campaign |
f | no | A numeric flight ID; if specified, only consider ads in that flight |
a | no | A numeric ad (flight-creative map) ID; if specified, only serve that ad if possible |
u | no | A URL that should be used as the click-through target for the ad |
p | no | A hash of key/value pairs used for Custom Targeting |
ck | no | A hash of key/value pairs used with ContentDB |
Here is a constructed request object with one placement:
{"p":[{"n":1234,"t":1234,"s":123456}]}Generating the VAST URL
Once you have a request object, URL-encode it and pass it to the VAST endpoint https://e-<networkId>.adzerk.net/vast3 using the ?r= querystring.
For example, this request object:
{"p":[{"n":1234,"t":1234,"s":123456}]}URL-encodes to:
%7B%22p%22%3A%5B%7B%22n%22%3A1234%2C%22t%22%3A1234%2C%22s%22%3A123456%7D%5D%7D%0A
which makes the ad code URL:
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%0AUpdated 7 days ago
