diff --git a/modules/sonobiBidAdapter.js b/modules/sonobiBidAdapter.js index 1ce7665ddfc..f8e338484b2 100644 --- a/modules/sonobiBidAdapter.js +++ b/modules/sonobiBidAdapter.js @@ -98,9 +98,16 @@ export const spec = { 'iqid': bidderSettings.get(BIDDER_CODE, 'storageAllowed') ? JSON.stringify(loadOrCreateFirstPartyData()) : null, }; + if (deepAccess(bidderRequest, 'ortb2.experianRtidData') && deepAccess(bidderRequest, 'ortb2.experianRtidKey')) { + payload.expData = deepAccess(bidderRequest, 'ortb2.experianRtidData'); + payload.expKey = deepAccess(bidderRequest, 'ortb2.experianRtidKey'); + } + const fpd = bidderRequest.ortb2; if (fpd) { + delete fpd.experianRtidData; // Omit the experian data since we already pass this through a dedicated query param + delete fpd.experianRtidKey payload.fpd = JSON.stringify(fpd); } @@ -156,11 +163,6 @@ export const spec = { payload.coppa = 0; } - if (deepAccess(bidderRequest, 'ortb2.experianRtidData') && deepAccess(bidderRequest, 'ortb2.experianRtidKey')) { - payload.expData = deepAccess(bidderRequest, 'ortb2.experianRtidData'); - payload.expKey = deepAccess(bidderRequest, 'ortb2.experianRtidKey'); - } - // If there is no key_maker data, then don't make the request. if (isEmpty(data)) { return null; diff --git a/test/spec/modules/sonobiBidAdapter_spec.js b/test/spec/modules/sonobiBidAdapter_spec.js index 83db7c0a812..fb50a90333d 100644 --- a/test/spec/modules/sonobiBidAdapter_spec.js +++ b/test/spec/modules/sonobiBidAdapter_spec.js @@ -501,7 +501,13 @@ describe('SonobiBidAdapter', function () { const bidRequests = spec.buildRequests(bidRequest, bidderRequests) expect(bidRequests.data.expData).to.equal('IkhlbGxvLCB3b3JsZC4gSGVsbG8sIHdvcmxkLiBIZWxsbywgd29ybGQuIg=='); expect(bidRequests.data.expKey).to.equal('sovrn-encryption-key-1'); - }) + }); + + it('should return a properly formatted request with experianRtidData and exexperianRtidKeypKey omitted from fpd', function () { + const bidRequests = spec.buildRequests(bidRequest, bidderRequests) + expect(bidRequests.data.fpd.indexOf('experianRtidData')).to.equal(-1); + expect(bidRequests.data.fpd.indexOf('exexperianRtidKeypKey')).to.equal(-1); + }); it('should return null if there is nothing to bid on', function () { const bidRequests = spec.buildRequests([{ params: {} }], bidderRequests)