diff --git a/modules/adtelligentBidAdapter.js b/modules/adtelligentBidAdapter.js index 2a27fb2a23f..cd00f0ae136 100644 --- a/modules/adtelligentBidAdapter.js +++ b/modules/adtelligentBidAdapter.js @@ -69,6 +69,7 @@ export const spec = { const chunkSize = deepAccess(adapterSettings, 'chunkSize', 10); const { tag, bids } = bidToTag(bidRequests, adapterRequest); const bidChunks = chunk(bids, chunkSize); + return _map(bidChunks, (bids) => { return { data: Object.assign({}, tag, { BidRequests: bids }), @@ -129,10 +130,10 @@ function parseRTBResponse(serverResponse, adapterRequest) { function bidToTag(bidRequests, adapterRequest) { // start publisher env const tag = createTag(bidRequests, adapterRequest); + if (window.adtDmp && window.adtDmp.ready) { tag.DMPId = window.adtDmp.getUID(); } - if (adapterRequest.gppConsent) { tag.GPP = adapterRequest.gppConsent.gppString; tag.GPPSid = adapterRequest.gppConsent.applicableSections?.toString(); @@ -140,12 +141,18 @@ function bidToTag(bidRequests, adapterRequest) { tag.GPP = adapterRequest.ortb2.regs.gpp; tag.GPPSid = adapterRequest.ortb2.regs.gpp_sid; } + const ageVerification = deepAccess(adapterRequest, 'ortb2.regs.ext.age_verification'); + + if (ageVerification) { + tag.AgeVerification = ageVerification; + } // end publisher env const bids = []; for (let i = 0, length = bidRequests.length; i < length; i++) { const bid = prepareBidRequests(bidRequests[i]); + bids.push(bid); } @@ -176,10 +183,12 @@ function prepareBidRequests(bidReq) { } if (mediaType === VIDEO) { const context = deepAccess(bidReq, 'mediaTypes.video.context'); + if (context === ADPOD) { bidReqParams.Adpod = deepAccess(bidReq, 'mediaTypes.video'); } } + return bidReqParams; } diff --git a/test/spec/modules/adtelligentBidAdapter_spec.js b/test/spec/modules/adtelligentBidAdapter_spec.js index 05743da6f16..6533addcf08 100644 --- a/test/spec/modules/adtelligentBidAdapter_spec.js +++ b/test/spec/modules/adtelligentBidAdapter_spec.js @@ -144,6 +144,12 @@ const displayBidderRequest = { bids: [{ bidId: '2e41f65424c87c' }] }; +const ageVerificationData = { + id: "123456789123456789", + status: "accepted", + decisionDate: "2011-10-05T14:48:00.000Z" +}; + const displayBidderRequestWithConsents = { bidderCode: 'bidderCode', bids: [{ bidId: '2e41f65424c87c' }], @@ -155,7 +161,14 @@ const displayBidderRequestWithConsents = { gppString: 'abc12345234', applicableSections: [7, 8] }, - uspConsent: 'iHaveIt' + uspConsent: 'iHaveIt', + ortb2: { + regs: { + ext: { + age_verification: ageVerificationData + } + } + } }; const videoEqResponse = [{ @@ -379,6 +392,9 @@ describe('adtelligentBidAdapter', () => { it('sets UserId\'s', () => { expect(bidRequestWithPubSettingsData.UserIds).to.be.deep.equal(DISPLAY_REQUEST.userId); }) + it('sets AgeVerification', () => { + expect(bidRequestWithPubSettingsData.AgeVerification).to.deep.equal(ageVerificationData); + }); }) });