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 - Dynamic TTL support (SAPR-15473) #6108

Merged
merged 39 commits into from
Dec 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
04cc599
ttl incoming value or default 300
Nov 26, 2020
40b4ead
ttl validation 0-3600
Nov 26, 2020
ab89685
Fix to oneVideo tests
Nov 29, 2020
bc87d35
added ttl unit tests
Nov 30, 2020
0b41147
updated md file
Nov 30, 2020
162635e
update minor version 3.0.5
Nov 30, 2020
f74e741
Updated unit test for minor version check
Nov 30, 2020
6ba19c6
remove x from liveIntentIdSystem_spec.js
Nov 30, 2020
82828d1
md conflict fix
Dec 3, 2020
dd7b80b
md conflict fix
Dec 3, 2020
38b9164
fix missing comma in md file
Dec 3, 2020
269a10d
merge master to branch
Dec 6, 2020
e2dee21
merging master to branch
Dec 7, 2020
e83c9a1
update minor version 3.0.5
Nov 30, 2020
8bb6387
remove x from liveIntentIdSystem_spec.js
Nov 30, 2020
40487c8
Merge branch 'SAPR-15473' of https://github.com/adam-browning/Prebid.js
Dec 9, 2020
10b0d41
Merge branch 'master' of https://github.com/prebid/Prebid.js
Dec 9, 2020
4d4c71c
Merge branch 'master' of https://github.com/prebid/Prebid.js
Dec 9, 2020
9b07564
Merge remote-tracking branch 'upstream/master' into SAPR-15473
Dec 9, 2020
4d92120
Merge branch 'master' of https://github.com/prebid/Prebid.js
Dec 10, 2020
81734fe
Merge branch 'master' into SAPR-15473
Dec 10, 2020
533b67b
update md file
Dec 10, 2020
0bf4662
added ttl to md file
Dec 10, 2020
bd89fd5
Merge branch 'master' into SAPR-15473
Dec 10, 2020
f7d1538
ttl incoming value or default 300
Nov 26, 2020
050b49f
ttl validation 0-3600
Nov 26, 2020
70451dd
Fix to oneVideo tests
Nov 29, 2020
285573a
added ttl unit tests
Nov 30, 2020
45460f0
updated md file
Nov 30, 2020
ac08ea2
update minor version 3.0.5
Nov 30, 2020
49feb78
Updated unit test for minor version check
Nov 30, 2020
a83f85e
remove x from liveIntentIdSystem_spec.js
Nov 30, 2020
fe9c252
md conflict fix
Dec 3, 2020
3c85a84
update minor version 3.0.5
Nov 30, 2020
a34c66a
remove x from liveIntentIdSystem_spec.js
Nov 30, 2020
687782d
update md file
Dec 10, 2020
fc761fa
added ttl to md file
Dec 10, 2020
7c0e10f
Merge branch 'SAPR-15473' of https://github.com/adam-browning/Prebid.…
Dec 10, 2020
af957f7
cleanup
Dec 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
5 changes: 2 additions & 3 deletions modules/oneVideoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {registerBidder} from '../src/adapters/bidderFactory.js';
const BIDDER_CODE = 'oneVideo';
export const spec = {
code: 'oneVideo',
VERSION: '3.0.4',
VERSION: '3.0.5',
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://pixel.advertising.com/ups/57304/sync?gdpr=&gdpr_consent=&_origin=0&redir=true',
Expand Down Expand Up @@ -99,7 +99,7 @@ export const spec = {
width: size.width,
height: size.height,
currency: response.cur,
ttl: 100,
ttl: (bidRequest.params.video.ttl > 0 && bidRequest.params.video.ttl <= 3600) ? bidRequest.params.video.ttl : 300,
netRevenue: true,
adUnitCode: bidRequest.adUnitCode
};
Expand All @@ -113,7 +113,6 @@ export const spec = {
} else if (bid.adm) {
bidResponse.vastXml = bid.adm;
}

if (bidRequest.mediaTypes.video) {
bidResponse.renderer = (bidRequest.mediaTypes.video.context === 'outstream') ? newRenderer(bidRequest, bidResponse) : undefined;
}
Expand Down
2 changes: 2 additions & 0 deletions modules/oneVideoBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Connects to Verizon Media's Video SSP (AKA ONE Video / Adap.tv) demand source to
inventoryid: 123,
minduration: 10,
maxduration: 30,
ttl: 300,
custom: {
key1: "value1",
key2: 123345
Expand Down Expand Up @@ -89,6 +90,7 @@ Connects to Verizon Media's Video SSP (AKA ONE Video / Adap.tv) demand source to
inventoryid: 123,
minduration: 10,
maxduration: 30,
ttl: 250
},
site: {
id: 1,
Expand Down
28 changes: 26 additions & 2 deletions test/spec/modules/oneVideoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ describe('OneVideoBidAdapter', function () {
const placement = bidRequest.params.video.placement;
const rewarded = bidRequest.params.video.rewarded;
const inventoryid = bidRequest.params.video.inventoryid;
const VERSION = '3.0.4';
const VERSION = '3.0.5';
expect(data.imp[0].video.w).to.equal(width);
expect(data.imp[0].video.h).to.equal(height);
expect(data.imp[0].bidfloor).to.equal(bidRequest.params.bidfloor);
Expand Down Expand Up @@ -407,7 +407,7 @@ describe('OneVideoBidAdapter', function () {
height: 480,
mediaType: 'video',
currency: 'USD',
ttl: 100,
ttl: 300,
netRevenue: true,
adUnitCode: bidRequest.adUnitCode,
renderer: (bidRequest.mediaTypes.video.context === 'outstream') ? newRenderer(bidRequest, bidResponse) : undefined,
Expand All @@ -434,6 +434,30 @@ describe('OneVideoBidAdapter', function () {
expect(bidResponse.mediaType).to.equal('banner');
expect(bidResponse.renderer).to.be.undefined;
});

it('should default ttl to 300', function () {
const serverResponse = {seatbid: [{bid: [{id: 1, adid: 123, crid: 2, price: 6.01, adm: '<VAST></VAST>'}]}], cur: 'USD'};
const bidResponse = spec.interpretResponse({ body: serverResponse }, { bidRequest });
expect(bidResponse.ttl).to.equal(300);
});
it('should not allow ttl above 3601, default to 300', function () {
bidRequest.params.video.ttl = 3601;
const serverResponse = {seatbid: [{bid: [{id: 1, adid: 123, crid: 2, price: 6.01, adm: '<VAST></VAST>'}]}], cur: 'USD'};
const bidResponse = spec.interpretResponse({ body: serverResponse }, { bidRequest });
expect(bidResponse.ttl).to.equal(300);
});
it('should not allow ttl below 1, default to 300', function () {
bidRequest.params.video.ttl = 0;
const serverResponse = {seatbid: [{bid: [{id: 1, adid: 123, crid: 2, price: 6.01, adm: '<VAST></VAST>'}]}], cur: 'USD'};
const bidResponse = spec.interpretResponse({ body: serverResponse }, { bidRequest });
expect(bidResponse.ttl).to.equal(300);
});
it('should use custom ttl if under 3600', function () {
bidRequest.params.video.ttl = 1000;
const serverResponse = {seatbid: [{bid: [{id: 1, adid: 123, crid: 2, price: 6.01, adm: '<VAST></VAST>'}]}], cur: 'USD'};
const bidResponse = spec.interpretResponse({ body: serverResponse }, { bidRequest });
expect(bidResponse.ttl).to.equal(1000);
});
});

describe('when GDPR and uspConsent applies', function () {
Expand Down