Skip to content

Commit

Permalink
Vidazoo - update build request (prebid#11918)
Browse files Browse the repository at this point in the history
* Add support for OMID parameters

* Add DSA to bidder request in vidazooUtils

* Update vidazooBidAdapter_spec to include omid source details

In this commit, vidazooBidAdapter_spec has been updated to include an additional API key, 7, in the 'api' array. Furthermore, 'source' object with 'ext', 'omidpn' and 'omidpv' fields has been added. This update enhances the configuration and source details of the adapter specification.

* fix Strings must use singlequote
  • Loading branch information
amitbiton01 authored Jul 22, 2024
1 parent cda06f4 commit 115e7c6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
16 changes: 16 additions & 0 deletions libraries/vidazooUtils/bidderUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,22 @@ export function buildRequestData(bid, topWindowUrl, sizes, bidderRequest, bidder
}
}

const api = deepAccess(mediaTypes, 'video.api', []);
if (api.includes(7)) {
const sourceExt = deepAccess(bidderRequest, 'ortb2.source.ext');
if (sourceExt?.omidpv) {
data.omidpv = sourceExt.omidpv;
}
if (sourceExt?.omidpn) {
data.omidpn = sourceExt.omidpn;
}
}

const dsa = deepAccess(bidderRequest, 'ortb2.regs.ext.dsa');
if (dsa) {
data.dsa = dsa;
}

_each(ext, (value, key) => {
data['ext.' + key] = value;
});
Expand Down
16 changes: 12 additions & 4 deletions test/spec/modules/vidazooBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const VIDEO_BID = {
'minduration': 0,
'startdelay': 0,
'linearity': 1,
'api': [2],
'api': [2, 7],
'placement': 1
}
}
Expand Down Expand Up @@ -157,8 +157,14 @@ const BIDDER_REQUEST = {
segment: [{id: '243'}],
},
],
},
source: {
ext: {
omidpn: 'MyIntegrationPartner',
omidpv: '7.1'
}
}
},
}
};

const SERVER_RESPONSE = {
Expand Down Expand Up @@ -359,7 +365,7 @@ describe('VidazooBidAdapter', function () {
webSessionId: webSessionId,
mediaTypes: {
video: {
api: [2],
api: [2, 7],
context: 'instream',
linearity: 1,
maxduration: 60,
Expand All @@ -373,7 +379,9 @@ describe('VidazooBidAdapter', function () {
protocols: [2, 3, 5, 6],
startdelay: 0
}
}
},
omidpn: 'MyIntegrationPartner',
omidpv: '7.1'
}
})
;
Expand Down

0 comments on commit 115e7c6

Please sign in to comment.