Skip to content

Commit

Permalink
vidazoo Bid Adapter: update support of metaData (prebid#9749)
Browse files Browse the repository at this point in the history
* feat(module): multi size request

* fix getUserSyncs
added tests

* update(module): package-lock.json from master

* feat(module): VidazooBidAdapter - send top query params to server

* feat: support metaData from server response.

* remove forgotten only on spec.

---------

Co-authored-by: Udi Talias <udi.talias@gmail.com>
Co-authored-by: roman <shmoop207@gmail.com>
  • Loading branch information
3 people authored Apr 10, 2023
1 parent 9a5553a commit 5b118ff
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
17 changes: 13 additions & 4 deletions modules/vidazooBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function interpretResponse(serverResponse, request) {

try {
results.forEach(result => {
const {creativeId, ad, price, exp, width, height, currency, advertiserDomains, mediaType = BANNER} = result;
const {creativeId, ad, price, exp, width, height, currency, advertiserDomains, metaData, mediaType = BANNER} = result;
if (!ad || !price) {
return;
}
Expand All @@ -241,11 +241,20 @@ function interpretResponse(serverResponse, request) {
currency: currency || CURRENCY,
netRevenue: true,
ttl: exp || TTL_SECONDS,
meta: {
advertiserDomains: advertiserDomains || []
}
};

if (metaData) {
Object.assign(response, {
meta: metaData
})
} else {
Object.assign(response, {
meta: {
advertiserDomains: advertiserDomains || []
}
})
}

if (mediaType === BANNER) {
Object.assign(response, {
ad: ad,
Expand Down
13 changes: 13 additions & 0 deletions test/spec/modules/vidazooBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,19 @@ describe('VidazooBidAdapter', function () {
});
});

it('should get meta from response metaData', function () {
const serverResponse = utils.deepClone(SERVER_RESPONSE);
serverResponse.body.results[0].metaData = {
advertiserDomains: ['vidazoo.com'],
agencyName: 'Agency Name',
};
const responses = adapter.interpretResponse(serverResponse, REQUEST);
expect(responses[0].meta).to.deep.equal({
advertiserDomains: ['vidazoo.com'],
agencyName: 'Agency Name'
});
});

it('should return an array of interpreted video responses', function () {
const responses = adapter.interpretResponse(VIDEO_SERVER_RESPONSE, REQUEST);
expect(responses).to.have.length(1);
Expand Down

0 comments on commit 5b118ff

Please sign in to comment.