diff --git a/modules/riseBidAdapter.js b/modules/riseBidAdapter.js index 78854129f8a..82790805303 100644 --- a/modules/riseBidAdapter.js +++ b/modules/riseBidAdapter.js @@ -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; } diff --git a/test/spec/modules/riseBidAdapter_spec.js b/test/spec/modules/riseBidAdapter_spec.js index 28bd123cb5d..ec9309fd4ae 100644 --- a/test/spec/modules/riseBidAdapter_spec.js +++ b/test/spec/modules/riseBidAdapter_spec.js @@ -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',