Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rise BidAdapter : add support for gpp #11051

Merged
merged 5 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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