Skip to content

Commit

Permalink
Rise Bid Adapter: support Coppa param (prebid#9837)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
9 people authored May 6, 2023
1 parent 71a5e21 commit 88095ca
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/riseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down Expand Up @@ -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;
Expand Down
18 changes: 18 additions & 0 deletions test/spec/modules/riseBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 88095ca

Please sign in to comment.