Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oneVideo Adapter End2End Testing Parameter Support (SAPR-13942) #5466

Merged
merged 30 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3e6d3bd
bidData Debug true if .source exists
Jul 7, 2020
d014050
capture and pass config.schain
Jul 7, 2020
ff4b733
changing from config.schain to bid.schain
Jul 7, 2020
a5b1419
updated schain unit tests
Jul 7, 2020
a614f35
updated schain unit tests
Jul 7, 2020
77b67a1
added schain examples to .md file
Jul 7, 2020
d3c609c
added e2etest unit tests
Jul 7, 2020
a252721
updated e2etest settings object
Jul 7, 2020
c9bf224
moved e2etest to correct position
Jul 7, 2020
420d15b
making sure master is synced
Jul 7, 2020
6498817
merging updated master into branch
Jul 7, 2020
64e7611
added global test endpoint
Jul 7, 2020
d064e6a
fixed eslint typo
Jul 7, 2020
7e5cd16
updated unit test for new global test endpoint
Jul 7, 2020
2f62381
backup before merging master
Jul 9, 2020
c865bb7
merging master into branch
Jul 9, 2020
20ba609
backup before merging master into branch
Jul 9, 2020
1bed85e
updated schain logic to use bidRequest.schain instead of global schai…
Jul 10, 2020
d6b6f5b
updated schain test to new bidRequest.schain logic
Jul 10, 2020
771dae1
backup before merge upstream
Jul 10, 2020
bcbd1eb
Update package-lock.json
adam-browning Jul 10, 2020
e4cda13
Delete package-lock.json
adam-browning Jul 10, 2020
f5ca381
restoring package.lock
Jul 10, 2020
253c24c
check
Jul 10, 2020
65f3136
Merge branch 'master' into SAPR-13942
Jul 10, 2020
6cf4439
restored package-lock.json
Jul 10, 2020
d42e006
resotred package-lock
Jul 10, 2020
e5d606a
managed conflicts
Jul 10, 2020
7420421
Merge branch 'master' into SAPR-13942
adam-browning Jul 10, 2020
8eae0d9
fixed lint issue
Jul 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
jsnellbaker marked this conversation as resolved.
Show resolved Hide resolved
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';
jsnellbaker marked this conversation as resolved.
Show resolved Hide resolved
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