Advertisements (Further as "ads") can be enabled on channels, recordings and media.
Each new ad added consist of 4 things:
- Url - Url to the VAST (Digital Video Ad Serving Template) file;
- Type - PRE (Before playback), MID (Somewhere in the middle) or POST (After playback);
- AD Type - VAST, VPAID or VMAP ad;
- Offset - Only used for ads that have type set to MID and will specify at what point of total video length to play the ad.
Each media can have only 1 PRE and 1 POST urls specified, but unlimited amount of MID urls.
For recordings and media, the MID type offset will be a percentage of the whole video length. I.e. 25% set on a video 60 seconds long will have an ad placed at 15 seconds.
For live channels the MID type offset will be a timecode (00:00:00) string after which an ad is shown. I.e. 00:00:30 set on a live channel will show an ad after 30 seconds of watching the live channel.
Ad settings for media in the admin panel:
Ad URLs in our system contain extra custom macros (Ones not specified in VAST specification) that will be replaced before the URL is called:
|Encoded URL of the page the media was embedded in||&page=[PAGE_ENCODED_URL] generates &page=http%3A%2F%2Fmediawebsite.com%2Fmediapage|
|[REQUEST_IP_COUNTRY]||Country code extracted from the request IP address based on Maxmind database||&country=[REQUEST_IP_COUNTRY] generates &country=US|
|[REQUEST_IP]||IP address of the user from the HTTP request||&ip=[REQUEST_IP] generates &ip=220.127.116.11|
|[REQUEST_USER_AGENT]||User agent string from HTTP request||&ua=[REQUEST_USER_AGENT] generates &ua=Mozilla/5.0%20(Windows%20NT%2010.0;%20Win64;%20x64) %20AppleWebKit/537.36%20(KHTML,%20like%20Gecko) %20Chrome/83.0.4103.116%20Safari/537.36|
|[REQUEST_HTTP_ACCEPT_LANGUAGE]||User language setting from the request||&lang=[REQUEST_HTTP_ACCEPT_LANGUAGE] generates &lang=lv|