Skip to content

Commit

Permalink
Merge pull request #3 from prebid/master
Browse files Browse the repository at this point in the history
update code base
  • Loading branch information
trchandraprakash authored Jul 13, 2020
2 parents d75ecbd + 4b0eb0b commit 6ac5d67
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 3 deletions.
20 changes: 18 additions & 2 deletions modules/oneVideoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const spec = {
code: 'oneVideo',
VERSION: '3.0.3',
ENDPOINT: 'https://ads.adaptv.advertising.com/rtb/openrtb?ext_id=',
E2ETESTENDPOINT: 'https://ads-wc.v.ssp.yahoo.com/rtb/openrtb?ext_id=',
SYNC_ENDPOINT1: 'https://cm.g.doubleclick.net/pixel?google_nid=adaptv_dbm&google_cm&google_sc',
SYNC_ENDPOINT2: 'https://pr-bh.ybp.yahoo.com/sync/adaptv_ortb/{combo_uid}',
SYNC_ENDPOINT3: 'https://match.adsrvr.org/track/cmf/generic?ttd_pid=adaptv&ttd_tpi=1',
Expand Down Expand Up @@ -53,11 +54,17 @@ export const spec = {
let consentData = bidRequest ? bidRequest.gdprConsent : null;

return bids.map(bid => {
let url = spec.ENDPOINT
let pubId = bid.params.pubId;
if (bid.params.video.e2etest) {
url = spec.E2ETESTENDPOINT;
pubId = 'HBExchange';
}
return {
method: 'POST',
/** removing adding local protocal since we
* can get cookie data only if we call with https. */
url: spec.ENDPOINT + bid.params.pubId,
url: url + pubId,
data: getRequestData(bid, consentData, bidRequest),
bidRequest: bid
}
Expand Down Expand Up @@ -290,7 +297,16 @@ function getRequestData(bid, consentData, bidRequest) {
bidData.regs.ext.us_privacy = bidRequest.uspConsent
}
}

if (bid.params.video.e2etest) {
bidData.imp[0].bidfloor = null;
bidData.imp[0].video.w = 300;
bidData.imp[0].video.h = 250;
bidData.imp[0].video.mimes = ['video/mp4', 'application/javascript'];
bidData.imp[0].video.api = [2];
bidData.site.page = 'https://verizonmedia.com';
bidData.site.ref = 'https://verizonmedia.com';
bidData.tmax = 1000;
}
return bidData;
}

Expand Down
32 changes: 32 additions & 0 deletions modules/oneVideoBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,38 @@ Connects to Verizon Media's Video SSP (AKA ONE Video / Adap.tv) demand source to
]
```

# End 2 End Testing Mode
By passing bid.params.video.e2etest = true you will be able to receive a test creative when connecting via VPN location U.S West Coast. This will allow you to trubleshoot how your player/ad-server parses and uses the VAST XML response.
This automatically sets default values for the outbound bid-request to respond from our test exchange.
No need to override the site/ref urls or change your pubId
```
var adUnits = [
{
code: 'video-1',
mediaTypes: {
video: {
context: "instream",
playerSize: [480, 640]
}
},
bids: [
{
bidder: 'oneVideo',
params: {
video: {
playerWidth: 300,
playerHeight: 250,
mimes: ['video/mp4', 'application/javascript'],
e2etest: true
}
pubId: 'YOUR_PUBLISHER_ID'
}
}
]
}
]
```

# Supply Chain Object Support
The oneVideoBidAdapter supports 2 methods for passing/creating an schain object.
1. By passing your Video SSP Org ID in the bid.video.params.sid - The adapter will create a new schain object and our ad-server will fill in the data for you.
Expand Down
22 changes: 21 additions & 1 deletion test/spec/modules/oneVideoBidAdapter_spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expect } from 'chai';
import { spec } from 'modules/oneVideoBidAdapter.js';
import * as utils from 'src/utils.js';
import {config} from 'src/config.js';

describe('OneVideoBidAdapter', function () {
let bidRequest;
Expand Down Expand Up @@ -239,6 +238,27 @@ describe('OneVideoBidAdapter', function () {
expect(data.imp[0].video.h).to.equal(height);
});

it('should set pubId to HBExchange when bid.params.video.e2etest = true', function () {
bidRequest.params.video.e2etest = true;
const requests = spec.buildRequests([ bidRequest ], bidderRequest);
expect(requests[0].method).to.equal('POST');
expect(requests[0].url).to.equal(spec.E2ETESTENDPOINT + 'HBExchange');
});

it('should attach End 2 End test data', function () {
bidRequest.params.video.e2etest = true;
const requests = spec.buildRequests([ bidRequest ], bidderRequest);
const data = requests[0].data;
expect(data.imp[0].bidfloor).to.not.exist;
expect(data.imp[0].video.w).to.equal(300);
expect(data.imp[0].video.h).to.equal(250);
expect(data.imp[0].video.mimes).to.eql(['video/mp4', 'application/javascript']);
expect(data.imp[0].video.api).to.eql([2]);
expect(data.site.page).to.equal('https://verizonmedia.com');
expect(data.site.ref).to.equal('https://verizonmedia.com');
expect(data.tmax).to.equal(1000);
});

it('it should create new schain and send it if video.params.sid exists', function () {
const requests = spec.buildRequests([ bidRequest ], bidderRequest);
const data = requests[0].data;
Expand Down

0 comments on commit 6ac5d67

Please sign in to comment.