// Check for DoubleVerify Quality Targeting signals before rendering the player (available in essence.com environments).
if ( 'undefined' !== typeof PQ ) {
PQ.cmd.push(function() {
// If DVQT signals are not available after 500ms, render the player anyway.
const timeout_id = setTimeout( jwPlayerRender, 500 );
// Get the "Authentic Direct" signals.
PQ.getTargeting({ signals: ['abs'] }, function(error, targetingData) {
clearTimeout(timeout_id);
jwPlayerRender( error ? undefined : targetingData );
});
});
} else {
jwPlayerRender();
}
function jwPlayerRender( dvqt_signals="" ) {
let jw_ad_tag = {"client":"googima","adscheduleid":"G7hR9pQ2","schedule":{"custom":{"tag":"https://pubads.g.doubleclick.net/gampad/ads?correlator=&iu=/21698916284/ess/VideoBeauty&env=vp&gdfp_req=1&output=vast&sz=1000x1&description_url=__page-url__&tfcd=0&npa=0&vpmute=0&vpa=auto&vad_type=linear&url=__page-url__&vpos=preroll&unviewed_position_start=1&v=tje4pyeG&pmnd=0&pmxd=60000&ad_rule=1&cust_params=ttid%3Dtje4pyeG%26frnch%3D__item-franchise__%26environment%3Dproduction%26kwblock%3DAbb%2CMicrosoft%2CAir%2CCapOne2%2CLincoln%2CUPS%2CVG%2CATTCric%2Cmcd%2CTargetbos%2CBuick%2CToyota%2Cdentsu%2CJohnson%2CMastercard%2Cjpmc%2CTylenol%2CNationwide%2CDisney%2CAT%26T+2023%2CAT%26T+Dream%2CTylenol2%2CPubW+Precision%2CGM%2Cattefoc3%2CWalmart%2CGMBuick2%2CHyundai2023","offset":"pre"}},"bids":{"bidders":[{"id":"jw-video-tje4pyeG","name":"MediaGrid","pubid":"evcxFIDZ"}],"settings":{"mediationLayerAdServer":"dfp","floorPriceCents":200,"floorPriceCurrency":"usd","buckets":[{"increment":0.1,"max":30,"min":0},{"increment":0.5,"max":50,"min":30}]}}};
// Inject DVQT signals into the ad request url.
if ( dvqt_signals && dvqt_signals.ABS.length > 0 ) {
let ad_url = new URL( jw_ad_tag.schedule.custom.tag );
let cust_params = decodeURIComponent( ad_url.searchParams.get("cust_params") );
// Replace the existing cust_params.
ad_url.searchParams.delete("cust_params");
let dvqt_param = "ABS=" + dvqt_signals.ABS.join( "," );
if ( cust_params ) {
cust_params += `&${dvqt_param}`;
} else {
cust_params = "cust_params=" + dvqt_param;
}
// Update the ad...
Continue reading