From 88095cad669961dffe441a88eea0e1ce6b9e0ba4 Mon Sep 17 00:00:00 2001 From: YakirLavi <73641910+YakirLavi@users.noreply.github.com> Date: Sat, 6 May 2023 14:15:28 +0300 Subject: [PATCH] Rise Bid Adapter: support Coppa param (#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 66c4e7b46121afc5331c8bca6e2fc972fc55f090. * bump * update coppa fetch * setting coppa param update * update Coppa tests * update test naming --------- Co-authored-by: Noam Tzuberi Co-authored-by: noamtzu Co-authored-by: Noam Tzuberi Co-authored-by: Laslo Chechur Co-authored-by: OronW <41260031+OronW@users.noreply.github.com> Co-authored-by: lasloche <62240785+lasloche@users.noreply.github.com> Co-authored-by: inna Co-authored-by: YakirLavi --- modules/riseBidAdapter.js | 6 ++++++ test/spec/modules/riseBidAdapter_spec.js | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/modules/riseBidAdapter.js b/modules/riseBidAdapter.js index 89e4e85c627..e0f196fb072 100644 --- a/modules/riseBidAdapter.js +++ b/modules/riseBidAdapter.js @@ -292,6 +292,7 @@ function generateBidParameters(bid, bidderRequest) { bidderRequestId: getBidIdParameter('bidderRequestId', bid), loop: getBidIdParameter('bidderRequestsCount', bid), transactionId: getBidIdParameter('transactionId', bid), + coppa: 0 }; const pos = deepAccess(bid, `mediaTypes.${mediaType}.pos`); @@ -364,6 +365,11 @@ function generateBidParameters(bid, bidderRequest) { if (protocols) { bidObject.protocols = protocols; } + + const coppa = deepAccess(bid, 'ortb2.regs.coppa') + if (coppa) { + bidObject.coppa = 1; + } } return bidObject; diff --git a/test/spec/modules/riseBidAdapter_spec.js b/test/spec/modules/riseBidAdapter_spec.js index 4fa4ff354ec..d22cbc01d39 100644 --- a/test/spec/modules/riseBidAdapter_spec.js +++ b/test/spec/modules/riseBidAdapter_spec.js @@ -341,6 +341,24 @@ describe('riseAdapter', function () { expect(request.data.bids[0]).to.be.an('object'); expect(request.data.bids[0]).to.have.property('floorPrice', 1.5); }); + + describe('COPPA Param', function() { + it('should set coppa equal 0 in bid request if coppa is set to false', function() { + const request = spec.buildRequests(bidRequests, bidderRequest); + expect(request.data.bids[0].coppa).to.be.equal(0); + }); + + it('should set coppa equal 1 in bid request if coppa is set to true', function() { + const bid = utils.deepClone(bidRequests[0]); + bid.ortb2 = { + 'regs': { + 'coppa': true, + } + }; + const request = spec.buildRequests([bid], bidderRequest); + expect(request.data.bids[0].coppa).to.be.equal(1); + }); + }); }); describe('interpretResponse', function () {