Menu
AWS Elemental MediaTailor
User Guide

Session Data

AWS Elemental MediaTailor generates data about each playback session. AWS Elemental MediaTailor replaces the session and avail query parameters in the template ADS request URL with this data when making a request to the ADS. You can also concatenate multiple variables together to achieve the value that you want.

You can use the following variables in the template ADS request URL:

  • [session.avail_duration_ms] – the duration in milliseconds of the ad availability slot that is being requested. AWS Elemental MediaTailor obtains the duration value from the input manifest’s #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 break in those tags, AWS Elemental MediaTailor uses a default value of 300,000 ms.

  • [session.avail_duration_secs] – the duration in seconds of the ad availability slot that is being requested. AWS Elemental MediaTailor obtains the duration value from the input manifest’s #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 break in those tags, AWS Elemental MediaTailor uses a default value of 300 seconds.

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

  • [session.id] – unique numeric identifier for the current playback session. All requests that a player makes during a session have the same value for this field, 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. This variable is set to the value of the Referer header that the player uses in its request to AWS Elemental MediaTailor. If the player doesn't include this header, the [session.referer] value is empty. If you're using a CDN or proxy in front of the manifest endpoint, you must proxy the correct header from the player here.

  • [session.user_agent] – the User-Agent header that AWS Elemental MediaTailor received from the player’s session initialization request. If you're using a CDN or proxy in front of the manifest endpoint, you must proxy the correct header from the player here.

  • [session.uuid] – alternative to [session.id]. This is a unique identifier for the current playback session, such as the following:

    e039fd39-09f0-46b2-aca9-9871cc116cde
  • [avail.random] – a random number between 0 and 10000000000 that AWS Elemental MediaTailor generates for each request to the ADS. Some ad servers use this parameter to enable features such as separating ads from competing companies.

  • [event_id] – the value parsed from the SCTE-35 field splice_event_id as a long number. AWS Elemental MediaTailor uses this value to designate linear ad break numbers or to populate ad server query strings, like ad pod positions.

  • [avail_num] – the value parsed from the SCTE-35 field avail_num. AWS Elemental MediaTailor can use this value to designate linear ad break numbers.

Example

If the ADS requires a query parameter named deviceSession to be passed with the unique session identifier, the template ADS URL in AWS Elemental MediaTailor could look like the following:

https://my.ads.server.com/path?deviceSession=[session.id]

AWS Elemental MediaTailor automatically generates a unique identifier for each stream, and enters the identifier in place of session.id. If the identifier is 1234567, the final request that AWS Elemental MediaTailor makes to the ADS would look something like this:

https://my.ads.server.com/path?deviceSession=1234567