Skip to content

Commit

Permalink
kargo - adding support for vast url in bid response (prebid#9447)
Browse files Browse the repository at this point in the history
  • Loading branch information
andyrusiecki authored and jorgeluisrocha committed May 18, 2023
1 parent 7394a94 commit 869fd38
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/kargoBidAdapter.js
Expand Up @@ -116,7 +116,11 @@ export const spec = {
};

if (meta.mediaType == VIDEO) {
bidResponse.vastXml = adUnit.adm;
if (adUnit.admUrl) {
bidResponse.vastUrl = adUnit.admUrl;
} else {
bidResponse.vastXml = adUnit.adm;
}
}

bidResponses.push(bidResponse);
Expand Down
32 changes: 32 additions & 0 deletions test/spec/modules/kargoBidAdapter_spec.js
Expand Up @@ -556,6 +556,17 @@ describe('kargo adapter tests', function () {
mediaType: 'video',
metadata: {},
currency: 'EUR'
},
6: {
id: 'bar',
cpm: 2.5,
adm: '',
admUrl: 'https://foobar.com/vast_adm',
width: 300,
height: 250,
mediaType: 'video',
metadata: {},
currency: 'EUR'
}
}}, {
currency: 'USD',
Expand Down Expand Up @@ -584,6 +595,11 @@ describe('kargo adapter tests', function () {
params: {
placementId: 'bar'
}
}, {
bidId: 6,
params: {
placementId: 'bar'
}
}]
});
var expectation = [{
Expand Down Expand Up @@ -664,6 +680,22 @@ describe('kargo adapter tests', function () {
meta: {
mediaType: 'video'
}
}, {
requestId: '6',
cpm: 2.5,
width: 300,
height: 250,
ad: '',
vastUrl: 'https://foobar.com/vast_adm',
ttl: 300,
creativeId: 'bar',
dealId: undefined,
netRevenue: true,
currency: 'EUR',
mediaType: 'video',
meta: {
mediaType: 'video'
}
}];
expect(resp).to.deep.equal(expectation);
});
Expand Down

0 comments on commit 869fd38

Please sign in to comment.