diff --git a/modules/oneVideoBidAdapter.js b/modules/oneVideoBidAdapter.js index f125d88c80c..17ecf9b1de9 100644 --- a/modules/oneVideoBidAdapter.js +++ b/modules/oneVideoBidAdapter.js @@ -228,12 +228,13 @@ function getRequestData(bid, consentData, bidRequest) { if (bid.params.site && bid.params.site.id) { bidData.site.id = bid.params.site.id } - if (isConsentRequired(consentData)) { + if (isConsentRequired(consentData) || (bidRequest && bidRequest.uspConsent)) { bidData.regs = { - ext: { - gdpr: 1 - } + ext: {} }; + if (isConsentRequired(consentData)) { + bidData.regs.ext.gdpr = 1 + } if (consentData.consentString) { bidData.user = { @@ -242,13 +243,10 @@ function getRequestData(bid, consentData, bidRequest) { } }; } - } - if (bidRequest && bidRequest.uspConsent) { - bidData.regs = { - ext: { - us_privacy: bidRequest.uspConsent - } - }; + // CCPA support + if (bidRequest && bidRequest.uspConsent) { + bidData.regs.ext.us_privacy = bidRequest.uspConsent + } } return bidData; diff --git a/test/spec/modules/oneVideoBidAdapter_spec.js b/test/spec/modules/oneVideoBidAdapter_spec.js index 3d21601387b..a87bff33f4b 100644 --- a/test/spec/modules/oneVideoBidAdapter_spec.js +++ b/test/spec/modules/oneVideoBidAdapter_spec.js @@ -196,14 +196,14 @@ describe('OneVideoBidAdapter', function () { }); }); - describe('when GDPR applies', function () { + describe('when GDPR and uspConsent applies', function () { beforeEach(function () { bidderRequest = { 'gdprConsent': { 'consentString': 'test-gdpr-consent-string', 'gdprApplies': true }, - 'uspConsent\'s': '1YN-', + 'uspConsent': '1YN-', 'bidderCode': 'oneVideo', 'auctionId': 'e158486f-8c7f-472f-94ce-b0cbfbb50ab4', 'bidderRequestId': '1e498b84fffc39', @@ -221,9 +221,16 @@ describe('OneVideoBidAdapter', function () { mockConfig = { consentManagement: { - cmpApi: 'iab', - timeout: 1111, - allowAuctionWithoutConsent: 'cancel' + gdpr: { + cmpApi: 'iab', + timeout: 3000, + allowAuctionWithoutConsent: 'cancel' + }, + usp: { + cmpApi: 'iab', + timeout: 1000, + allowAuctionWithoutConsent: 'cancel' + } } }; }); @@ -243,6 +250,12 @@ describe('OneVideoBidAdapter', function () { expect(request[0].data.regs.ext.us_privacy).to.equal(bidderRequest.uspConsent); }); + it('should send the uspConsent and GDPR ', function () { + const request = spec.buildRequests([ bidRequest ], bidderRequest); + expect(request[0].data.regs.ext.gdpr).to.equal(1); + expect(request[0].data.regs.ext.us_privacy).to.equal(bidderRequest.uspConsent); + }); + it('should send schain object', function () { const requests = spec.buildRequests([ bidRequest ], bidderRequest); const data = requests[0].data;