Skip to content

Commit

Permalink
Rise BidAdapter : add support for gpp (#11051)
Browse files Browse the repository at this point in the history
* support gpp in rise and minutemedia

* modified tests

* removed mm gpp support

* updated rise test

* fix for gpp section

---------

Co-authored-by: Inna Yaretsky <>
  • Loading branch information
innay authored Feb 5, 2024
1 parent 6f93a5b commit 16ee425
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/riseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,14 @@ function generateGeneralParams(generalObject, bidderRequest) {
generalParams.gdpr_consent = bidderRequest.gdprConsent.consentString;
}

if (bidderRequest && bidderRequest.gppConsent) {
generalParams.gpp = bidderRequest.gppConsent.gppString;
generalParams.gpp_sid = bidderRequest.gppConsent.applicableSections;
} else if (bidderRequest.ortb2?.regs?.gpp) {
generalParams.gpp = bidderRequest.ortb2.regs.gpp;
generalParams.gpp_sid = bidderRequest.ortb2.regs.gpp_sid;
}

if (generalBidParams.ifa) {
generalParams.ifa = generalBidParams.ifa;
}
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 @@ -324,6 +324,24 @@ describe('riseAdapter', function () {
expect(request.data.params).to.have.property('gdpr_consent', 'test-consent-string');
});

it('should not send the gpp param if gppConsent is false in the bidRequest', function () {
const bidderRequestWithoutGPP = Object.assign({gppConsent: false}, bidderRequest);
const request = spec.buildRequests(bidRequests, bidderRequestWithoutGPP);
expect(request.data.params).to.be.an('object');
expect(request.data.params).to.not.have.property('gpp');
expect(request.data.params).to.not.have.property('gpp_sid');
});

it('should send the gpp param if gppConsent is true in the bidRequest', function () {
const bidderRequestWithGPP = Object.assign({gppConsent: {gppString: 'gpp-consent', applicableSections: [7]}}, bidderRequest);
const request = spec.buildRequests(bidRequests, bidderRequestWithGPP);
console.log('request.data.params');
console.log(request.data.params);
expect(request.data.params).to.be.an('object');
expect(request.data.params).to.have.property('gpp', 'gpp-consent');
expect(request.data.params.gpp_sid[0]).to.be.equal(7);
});

it('should have schain param if it is available in the bidRequest', () => {
const schain = {
ver: '1.0',
Expand Down

0 comments on commit 16ee425

Please sign in to comment.