To enjoy all our Developer Portal features, please switch to Microsoft Edge, Google Chrome or Mozilla Firefox browsers.

How to customize request with the "ads_params” parameter

Posted on by Shimalika Rachala

Thanks to the Dailymotion Player, Publishers disposing of applicable consent or other legal basis for end-users’ data processing can retrieve valuable information about their specific environment, such as Player size, URL referrer, as well as information about the content and device. All this and much more can be passed dynamically to their VAST tag. In addition, if they want to retrieve more detailed information about their ads to better track and target their end-users, we recommend using the “ads_ params” variable. Here’s how to implement it.

There are several ways you can implement the “ads_params” parameterData API, SDKs (JavaScript, Android, and iOS), iFrame, or MRSS feed.  

Please note: you only need to select one solution that works best for you. Once the setup is done, the values will automatically pass in your VAST tags. 

Using Dailymotion’s Data API 

To use this method, you need to retrieve an API Key with the “can-manage-ads" role attached. 

  • Go to our API Explorer: https://developer.dailymotion.com/tools/  
  • Authenticate using the right application (API Key) 
  • Click on POST /video/{id} from the video tab 
  • Fill the advertising_custom_target parameter field using this syntax: test1/tes2/test3 
  •  Click on the Test button 

Tips : Select the advertising_custom_target field to get it in the API result 

 

Using Dailymotion’s SDKs 

When you load a video with one of our SDKs, the “ads_params” can be added as an optional parameter along with the video ID: 

Javascript SDK 

player.load(' x5s90td’, { 
    autoplay: true, 
    start: 30, 
    ads_params’: ’helloworld’ 
}) 

iOS SDK  

let payloadParameters = [ “ads_params”:”premium”] 
let  data = try! JSONSerialization.data(withJSONObject: payloadParameters, options[]) 
let payload = String(data, encoding: .utf8)! 
PlayerViewController.load(videoId: “x5s90td’, payload: payload) 

Android SDK  

Map<String, String> playerParams = new HashMap<>(); 
playerParams.put(“ads_params”, ”helloworld”); 
mVideoView.load(“x5s90td’”, playerParams); 

VAST tag: http://pubads.g.doubleclick.net/gampad/live/ads?sz=320x180|640x360|400x300|468x60|640x480&iu=/XXXX/DESKTOPtest//Home//PrerollVideo&impl=s& gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=http://test.com/12345& description_url=news.dailymotion.com&correlator=6503902658&cust_params=helloworld 

Querying String within the Iframe src 

You can use the following example to pass several values in the same query string: 

<iframe id =”player” frameborder =”0” allowfullscreen=”true” title=”dailymotion video player” width=”100%” height=”100%” src=”https://www.dailymotion.com/embed/video/x5s90td?ads_params=blue/red/white&api=postmessage&autoplay=true&id=player&origin=http://test.com”></iframe> 


 VAST tag: http://pubads.g.doubleclick.net/gampad/live/ads?sz=320x180|640x360|400x300|468x60|640x480&iu=/XXXX/DESKTOPtest//Home//PrerollVideo&impl=s& gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=http://test.com/12345& description_url=news.dailymotion.com&correlator=6503902658&param1=blue&param2=red&param3=white 

Through the MRSS Feed 

In order to add the “ads_params” while uploading through the MRSS feed, you will need to add a tag, as shown below:  

<title>Ad_Params</title> 
<description>Sample description</description> 
<adparam>helloworld</adparam> 
<media:content url=http://dailymotion.com”...> 


Offering customized experience to Publishers is our top priority at Dailymotion. Learn more about our Partner Program by visiting our dedicated website

Posted in Data API
Tagged API Explorer, SDK and ads