Skip to content

Commit 88095ca

Browse files
YakirLavinoamtzuberinoamtzuLaslo ChechurOronW
authored
Rise Bid Adapter: support Coppa param (prebid#9837)
* 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 --------- 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 71a5e21 commit 88095ca

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

modules/riseBidAdapter.js

+6
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ function generateBidParameters(bid, bidderRequest) {
292292
bidderRequestId: getBidIdParameter('bidderRequestId', bid),
293293
loop: getBidIdParameter('bidderRequestsCount', bid),
294294
transactionId: getBidIdParameter('transactionId', bid),
295+
coppa: 0
295296
};
296297

297298
const pos = deepAccess(bid, `mediaTypes.${mediaType}.pos`);
@@ -364,6 +365,11 @@ function generateBidParameters(bid, bidderRequest) {
364365
if (protocols) {
365366
bidObject.protocols = protocols;
366367
}
368+
369+
const coppa = deepAccess(bid, 'ortb2.regs.coppa')
370+
if (coppa) {
371+
bidObject.coppa = 1;
372+
}
367373
}
368374

369375
return bidObject;

test/spec/modules/riseBidAdapter_spec.js

+18
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,24 @@ describe('riseAdapter', function () {
341341
expect(request.data.bids[0]).to.be.an('object');
342342
expect(request.data.bids[0]).to.have.property('floorPrice', 1.5);
343343
});
344+
345+
describe('COPPA Param', function() {
346+
it('should set coppa equal 0 in bid request if coppa is set to false', function() {
347+
const request = spec.buildRequests(bidRequests, bidderRequest);
348+
expect(request.data.bids[0].coppa).to.be.equal(0);
349+
});
350+
351+
it('should set coppa equal 1 in bid request if coppa is set to true', function() {
352+
const bid = utils.deepClone(bidRequests[0]);
353+
bid.ortb2 = {
354+
'regs': {
355+
'coppa': true,
356+
}
357+
};
358+
const request = spec.buildRequests([bid], bidderRequest);
359+
expect(request.data.bids[0].coppa).to.be.equal(1);
360+
});
361+
});
344362
});
345363

346364
describe('interpretResponse', function () {

0 commit comments

Comments
 (0)