Skip to content

Commit 8b7bab1

Browse files
YakirLavinoamtzuberinoamtzuLaslo ChechurOronW
authored
MinuteMedia Bid Adapter: support sua and plcmt params (prebid#9997)
* add Rise adapter * fixes * change param isOrg to org * Rise adapter * change email for rise * fix circle failed * bump * bump * bump * remove space * Upgrade Rise adapter to 5.0 * added isWrapper param * addes is_wrapper parameter to documentation * added is_wrapper to test * removed isWrapper * Rise Bid Adapter: support Coppa param (#24) * MinuteMedia Bid Adapter: support Coppa param (#25) * Revert "MinuteMedia Bid Adapter: support Coppa param (#25)" (#26) This reverts commit 66c4e7b. * bump * update coppa fetch * setting coppa param update * update Coppa tests * update test naming * support plcmt and sua params + tests --------- Co-authored-by: Noam Tzuberi <[email protected]> Co-authored-by: noamtzu <[email protected]> Co-authored-by: Noam Tzuberi <[email protected]> Co-authored-by: Laslo Chechur <[email protected]> Co-authored-by: OronW <[email protected]> Co-authored-by: lasloche <[email protected]> Co-authored-by: inna <[email protected]> Co-authored-by: YakirLavi <[email protected]>
1 parent c42cd5e commit 8b7bab1

File tree

2 files changed

+82
-4
lines changed

2 files changed

+82
-4
lines changed

modules/minutemediaBidAdapter.js

+13-3
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,16 @@ function generateBidParameters(bid, bidderRequest) {
307307
bidObject.placementId = placementId;
308308
}
309309

310+
const sua = deepAccess(bid, `ortb2.device.sua`);
311+
if (sua) {
312+
bidObject.sua = sua;
313+
}
314+
315+
const coppa = deepAccess(bid, `ortb2.regs.coppa`)
316+
if (coppa) {
317+
bidObject.coppa = 1;
318+
}
319+
310320
if (mediaType === VIDEO) {
311321
const playbackMethod = deepAccess(bid, `mediaTypes.video.playbackmethod`);
312322
let playbackMethodValue;
@@ -348,9 +358,9 @@ function generateBidParameters(bid, bidderRequest) {
348358
bidObject.linearity = linearity;
349359
}
350360

351-
const coppa = deepAccess(bid, `ortb2.regs.coppa`);
352-
if (coppa) {
353-
bidObject.coppa = 1;
361+
const plcmt = deepAccess(bid, `mediaTypes.video.plcmt`);
362+
if (plcmt) {
363+
bidObject.plcmt = plcmt;
354364
}
355365
}
356366

test/spec/modules/minutemediaBidAdapter_spec.js

+69-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ describe('minutemediaAdapter', function () {
5959
'mediaTypes': {
6060
'video': {
6161
'playerSize': [[640, 480]],
62-
'context': 'instream'
62+
'context': 'instream',
63+
'plcmt': 1
6364
}
6465
},
6566
'vastXml': '"<VAST version=\\\"2.0\\\">...</VAST>"'
@@ -116,6 +117,11 @@ describe('minutemediaAdapter', function () {
116117
expect(request.method).to.equal('POST');
117118
});
118119

120+
it('sends the plcmt to ENDPOINT via POST', function () {
121+
const request = spec.buildRequests(bidRequests, bidderRequest);
122+
expect(request.data.bids[0].plcmt).to.equal(1);
123+
});
124+
119125
it('sends bid request to TEST ENDPOINT via POST', function () {
120126
const request = spec.buildRequests(testModeBidRequests, bidderRequest);
121127
expect(request.url).to.equal(TEST_ENDPOINT);
@@ -294,6 +300,68 @@ describe('minutemediaAdapter', function () {
294300
expect(request.data.bids[0]).to.have.property('floorPrice', 1.5);
295301
});
296302

303+
it('should check sua param in bid request', function() {
304+
const sua = {
305+
'platform': {
306+
'brand': 'macOS',
307+
'version': ['12', '4', '0']
308+
},
309+
'browsers': [
310+
{
311+
'brand': 'Chromium',
312+
'version': [ '106', '0', '5249', '119' ]
313+
},
314+
{
315+
'brand': 'Google Chrome',
316+
'version': [ '106', '0', '5249', '119' ]
317+
},
318+
{
319+
'brand': 'Not;A=Brand',
320+
'version': [ '99', '0', '0', '0' ]
321+
}
322+
],
323+
'mobile': 0,
324+
'model': '',
325+
'bitness': '64',
326+
'architecture': 'x86'
327+
}
328+
const bid = utils.deepClone(bidRequests[0]);
329+
bid.ortb2 = {
330+
'device': {
331+
'sua': {
332+
'platform': {
333+
'brand': 'macOS',
334+
'version': [ '12', '4', '0' ]
335+
},
336+
'browsers': [
337+
{
338+
'brand': 'Chromium',
339+
'version': [ '106', '0', '5249', '119' ]
340+
},
341+
{
342+
'brand': 'Google Chrome',
343+
'version': [ '106', '0', '5249', '119' ]
344+
},
345+
{
346+
'brand': 'Not;A=Brand',
347+
'version': [ '99', '0', '0', '0' ]
348+
}
349+
],
350+
'mobile': 0,
351+
'model': '',
352+
'bitness': '64',
353+
'architecture': 'x86'
354+
}
355+
}
356+
}
357+
const requestWithSua = spec.buildRequests([bid], bidderRequest);
358+
const data = requestWithSua.data;
359+
expect(data.bids[0].sua).to.exist;
360+
expect(data.bids[0].sua).to.deep.equal(sua);
361+
const request = spec.buildRequests(bidRequests, bidderRequest);
362+
expect(request.data.bids[0].sua).to.not.exist;
363+
});
364+
297365
describe('COPPA Param', function() {
298366
it('should set coppa equal 0 in bid request if coppa is set to false', function() {
299367
const request = spec.buildRequests(bidRequests, bidderRequest);

0 commit comments

Comments
 (0)