Preview Ad

Ads can be previewed with custom ad parameters. This is useful for setting properties like zip code to see how the ad will display in specific regions.

Using the endpoint

This feature is available using the endpoint: https://pterodactylus.tremorvideo.com/adpreview/:tag

:tag is the Vast tag url. This must be encoded. Follow this with a query string of key-value pairs. Each value must be encoded.

The server will return XML with updated ad parameters. The URI can be used in a Vast player to view the ad.

Configuring the query string

Ad parameters can be overwritten by formatting the query string of the URI to include the name of the parameter and its new value. The query parameter key names must match the names of the actual ad parameters. To view the original xml, enter the Vast tag url in the address bar of the browser. The object in the <AdParameters> tags contains the ad parameters.

For instance, given a Vast tag of https://static.tremorvideo.com/m/2017/01/Bk1fCYCPg/vast2.xml, to set the debug parameter to false, use:

https://pterodactylus.tremorvideo.com/adpreview/https%3A%2F%2Fstatic.tremorvideo.com%2Fm%2F2017%2F01%2FBk1fCYCPg%2Fvast2.xml?debug=false

Example of nested ad parameters

Use dot notation to denote the keys of nested ad parameters in the query string. For instance:

<AdParameters> <![CDATA[ { "geoInfo": { "postalCode": "94102", "latitude": "123.4" }, "debug": true } ]]> </AdParameters>

would have a query string constructed as:

?geoInfo.postalCode=94102&geoInfo.latitude=123.4&debug=true

Complete example

Given a Vast tag of https://static.tremorvideo.com/m/2017/01/Bk1fCYCPg/vast2.xml

It has the following xml:

<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:noNamespaceSchemaLocation="vast.xsd"> <Ad id="1234567"> <InLine> <AdSystem>blink</AdSystem> <AdTitle>Linear VPAID</AdTitle> <Description>Vpaid Linear Video Ad</Description> <Error>https://www.example.com/error</Error> <Impression>https://www.example.com/impression</Impression> <Creatives> <Creative sequence="1"> <Linear> <Duration>00:00:30</Duration> <AdParameters> <![CDATA[ { "geoInfo": { "postalCode": "94102" }, "adChoices": { "position": "top-left" }, "duration": "00:00:30", "debug": true } ]]> </AdParameters> <TrackingEvents> <Tracking event="start">https://www.example.com/start</Tracking> <Tracking event="acceptInvitation">https://www.example.com/acceptInvitation</Tracking> </TrackingEvents> <MediaFiles> <MediaFile apiFramework="VPAID" type="application/javascript"> <![CDATA[ https://static.tremorvideo.com/m/2017/01/Bk1fCYCPg/ad.js ]]> </MediaFile> </MediaFiles> </Linear> </Creative> </Creatives> </InLine> </Ad> </VAST>

To modify/add the following ad parameters:

geoInfo.latitude = 123.4 adChoices.position = top-right debug = false

Use the URI:

https://pterodactylus.tremorvideo.com/adpreview/https%3A%2F%2Fstatic.tremorvideo.com%2Fm%2F2017%2F01%2FBk1fCYCPg%2Fvast2.xml?geoInfo.latitude=123.4&adChoices.position=top-right&debug=false

Enter the URI into a Vast player to preview the ad. The modified XML would be:

<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" xsi:noNamespaceSchemaLocation="vast.xsd"> <Ad id="1234567"> <InLine> <AdSystem>blink</AdSystem> <AdTitle>Linear VPAID</AdTitle> <Description>Vpaid Linear Video Ad</Description> <Error>https://www.example.com/error</Error> <Impression>https://www.example.com/impression</Impression> <Creatives> <Creative sequence="1"> <Linear> <Duration>00:00:30</Duration> <AdParameters> { "geoInfo": { "postalCode": "94102", "latitude": "123.4" }, "adChoices": { "position": "top-right" }, "duration": "00:00:30", "debug": false } </AdParameters> <TrackingEvents> <Tracking event="start">https://www.example.com/start</Tracking> <Tracking event="acceptInvitation">https://www.example.com/acceptInvitation</Tracking> </TrackingEvents> <MediaFiles> <MediaFile apiFramework="VPAID" type="application/javascript"> https://static.tremorvideo.com/m/2017/01/Bk1fCYCPg/ad.js </MediaFile> </MediaFiles> </Linear> </Creative> </Creatives> </InLine> </Ad> </VAST>