Skip to main content

Setting up Dynamic Ad Insertion in Video Center

Video Center integrates with AWS Media Services’ MediaTailor to perform dynamic ad insertion into video-on-demand (VOD) and live video streams.

Ad Decision Server URL

rId20.png

The Ad Decision Server URL configuration value specifies the URL template that MediaTailor uses to call out to an ad decision server (ADS). When an opportunity to display an ad is encountered in a VOD or live video stream, MediaTailor constructs a URL from this template, and calls it to retrieve the ad units and their assets for display. The ADS referenced by this URL must return, at minimum, a VAST response—VMAP and VPAID support are still under evaluation as of this writing.

When MediaTailor receives a response from the ADS, it downloads the video asset for the ad unit, and begins the process of transcoding the asset into the bitrate and resolution of the source video content. When the transcoding process is complete, that ad asset will be eligible to be stitched into future ad avails. In the meantime, any previously-downloaded and -transcoded ad assets will be stitched into the ad avail. If no ad asset is available, MediaTailor will either stitch in a configured slate asset, or show the underlying video content.

The ADS URL can be as simple or as complex as needed to target the correct ad units for VOD or live video stream content. The primary mechanism for tailoring this complexity comes from the use of parameters that can be inserted into the ADS URL in the form of “[<parameter>]”, where the parameter name is surrounded by square brackets.

These parameters are provided either by MediaTailor as part of the session, or by the player as configured in the client’s PoWa ad integration.

Session Parameters

The following parameters are provided by MediaTailor and can be included in the ADS URL template:

  • [avail.random]: A random number between 0 and 10,000,000,000 that is generated for each request to the ad decision server. Some ad servers can use this parameter to enable features such as separating ads from competing companies.

  • [scte.avail_num]: The value parsed by MediaTailor from the SCTE-35 field avail_num.

  • [scte.event_id]: The value parsed by MediaTailor from the SCTE-35 field splice_event_id, as a long number.

  • [scte.unique_program_id]: The value parsed by MediaTailor from the SCTE-35 splice_insert field unique_program_id. The ADS uses the unique program ID (UPID) to provide program-level ad targeting for live linear streams. If the SCTE-35 command is not splice insert, MediaTailor sets this to an empty value.

  • [session.avail_duration_ms]: The duration in milliseconds of the ad availability slot. The default value is 300,000 ms. MediaTailor obtains the duration value from the input manifest from the #EXT-X-CUE-OUT: DURATION or from values in the #EXT-X-DATERANGE tag. If the input manifest has a null, invalid, or 0 duration for the ad avail in those tags, MediaTailor uses the default.

  • [session.avail_duration_secs]: The duration in seconds of the ad availability slot, or ad avail. MediaTailor determines this value the same way it determines [session.avail_duration_ms].

  • [session.client_ip]: The remote IP address that the MediaTailor request came from. If the X-forwarded-for header is set, then that value is what MediaTailor uses for the client_ip.

  • [session.id]: A unique numeric identifier for the current playback session. All requests that a player makes for a session have the same id, so it can be used for ADS fields that are intended to correlate requests for a single viewing.

  • [session.referer]: Usually, the URL of the page that is hosting the video player. MediaTailor sets this variable to the value of the Referer header that the player used in its request for the video. If the player doesn’t provide this header, MediaTailor leaves the [session.referer] empty.

  • [session.user_agent]: The User-Agent header that MediaTailor received from the player’s session initialization request.

  • [session.uuid]: An alternative to [session.id]. This is a unique identifier for the current playback session.

Player Parameters

The parameters provided by the player will depend highly on a client’s Video Player ad integration configuration.

When the player receives an ad tag from the ad integration, it parses out the query string parameters and passes them up to MediaTailor as part of the call. For example, if the Video Player ad integration returns the following ad tag:

http://pubads.g.doubleclick.net/gampad/ads?sz=1280x720&iu=/1234/video&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1

it will parse the parameters out as follows:

sz=1280x720
iu=/1234/video
impl=s
gdfp_req=1
env=vp
output=vast
unviewed_position_start=1

These then become available to use in the ADS URL template by using “[player.<parameter>]”. For example, the “sz” parameter from the player can be inserted into the ADS URL template using “[player.sz]”.

Example

An ADS URL template may look like the following:

https://pubads.g.doubleclick.net/gampad/ads?description_url=[session.referer]&url=[session.referer]&correlator=[avail.random]&sz=[player_params.sz]&iu=[player_params.iu]&impl=[player_params.impl]&gdfp_req=[player_params.gdfp_req]&env=[player_params.env]&output=[player_params.output]&unviewed_position_start=[player_params.unviewed_position_start]&vad_type=linear

Https://Pubads.G.Doubleclick.Net/Gampad/Ads?Description_url=[Session.Referer]&Url=[Session.Referer]&Correlator=[Avail.Random]&Ciu_szs=[Player_params.Ciu_szs]&Sz=[Player_params.Sz]&Iu=[Player_params.Iu]&Cust_params=[Player_params.Cust_params]&Impl=[Player_params.Impl]&Gdfp_req=[Player_params.Gdfp_req]&Env=[Player_params.Env]&Output=[Player_params.Output]&Unviewed_position_start=[Player_params.Unviewed_position_start]&Vad_type=Linea

This is a URL template to target a request to a DFP ADS. Looking at the parameters, it can be seen that the URL is populated with both session and player parameters. From the session parameters, it can be seen that the following are used:

...
description_url=[session.referer]&
url=[session.referer]&
correlator=[avail.random]&
...

Player parameters are also used in this URL template:

...
sz=[player_params.sz]&
iu=[player_params.iu]&
impl=[player_params.impl]&
gdfp_req=[player_params.gdfp_req]&
env=[player_params.env]&
output=[player_params.output]&
unviewed_position_start=[player_params.unviewed_position_start]&
...

And, the following static parameters are used:

...
vad_type=linear
...