Sending Segments to JW Player

In this article

A guide to sending segments into JW Player

To pass Permutive segments into JW Player for targeting you'll need to make a small update to your player implementation:

First you need to create a variable with all Permutive segments;

var playerSegsPerm = encodeURIComponent('&permutive=' + encodeURIComponent(JSON.parse(localStorage._pdfps || '[]').slice(0,250).join(',')));

Next you need to update advertising.tag or advertising.schedule (depending on your setup) to include the variable data. This can be done by appending playerSegsPerm to your cust_params or custom_params.

Note: that the below examples assume that cust_param is the last parameter of the tag/schedule URL. If this is not the case you need to make sure to add playerSegsPerm at the right location (after cust_param and before the last &).

 

Updating your player 

If your JW Player initialisation looks like this:

you need to update it like below:

 

cust_params not last URL parameter

See below as an example of how you could include the Permutive segments at the right location. Please note that this is only an example and might need to be adjusted for your setup.

var tagURL = '...'; // your advertising.tag or advertising.schedule
var playerSegsPerm = encodeURIComponent('&permutive=' + encodeURIComponent(JSON.parse(localStorage._pdfps || '[]').slice(0,250).join(',')));
 
tagURL = tagURL.replace(/(cust_params[^&]+)/, '$1' + playerSegsPerm);

 

More examples

var playerSegsPerm = encodeURIComponent('&permutive=' + encodeURIComponent(JSON.parse(localStorage._pdfps || '[]').slice(0,250).join(',')));
jwplayer("player").setup({
  width: '100%',
  height: '100%',
  autostart: true,
  aspectratio: "16:9",
  displaytitle: false,
  playlist: [{
    image: "<https://www.domain.com.au/dimg/640x360/dimg/mre18_025_iphonexs_xsmax-100771795-orig.jpg>",
    mediaid: "None",
    sources: [{
      file: "<https://s3-ap-southeast-2.amazonaws.com/domain.storage/videos_converted/videos/files/mre18_025_iphonexs_xsmax-90587-orig.mp4>",
      label: "HD"
    }],
    title: ""
  }],
  advertising: {
    client: "vast",
    schedule: "<https://pubads.g.doubleclick.net/gampad/ads?sz=640x360&amp;iu=/1234/domain.com.au/ros_section&amp;ciu_szs&amp;impl=s&amp;gdfp_req=1&amp;env=vp&amp;output=xml_vmap1&amp;unviewed_position_start=1&amp;url=http%3A//www.domain.com.au/video/646656/apple-iphone-xs-xs-max-unveil/&amp;correlator=8406446&amp;custom_params=node%3D646656%26site%3Dpcw>" + playerSegsPerm
  },
  sharing: {
    link: "<http://www.domain.com.au/video/646656/apple-iphone-xs-xs-max-unveil/>",
  }
});
Note:
  • This integration only works for targeting and not event collection
  • This integration only works on web (not AMP or FIA)

If you have any questions, please contact customer support by emailing support@permutive.com or chat to the Customer Operations Team via the LiveChat icon in the bottom right corner of your screen.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request