Skip to content

Commit

Permalink
Gambid adapter: Provide "mediaType" for all bids, and "vastUrl" prope…
Browse files Browse the repository at this point in the history
…rty for video bids (prebid#2825)
  • Loading branch information
arikkfir authored and dluxemburg committed Jul 17, 2018
1 parent a8c04f2 commit eb9ad72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/gambidBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ export const spec = {
currency: bid.cur || response.cur
};
if (!bidRequest.bidRequest.mediaTypes || bidRequest.bidRequest.mediaTypes.banner) {
outBids.push(Object.assign({}, outBid, { ad: bid.adm }));
} else if (bidRequest.bidRequest.mediaTypes && bidRequest.bidRequest.mediaTypes.video) {
outBids.push(Object.assign({}, outBid, { vastXml: bid.adm }));
outBids.push(Object.assign({}, outBid, { mediaType: 'banner', ad: bid.adm }));
} else if (bidRequest.bidRequest.mediaTypes.video) {
outBids.push(Object.assign({}, outBid, { mediaType: 'video', vastUrl: bid.ext.vast_url, vastXml: bid.adm }));
}
});
return outBids;
Expand Down
3 changes: 3 additions & 0 deletions test/spec/modules/gambidBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ describe('GambidAdapter', () => {
'h': 600,
'w': 120,
'ext': {
'vast_url': 'http://my.vast.com',
'utrk': [
{ 'type': 'iframe', 'url': '//p.partner1.io/user/sync/1' }
]
Expand Down Expand Up @@ -306,6 +307,7 @@ describe('GambidAdapter', () => {
expect(ad0.currency).to.equal(rtbResponse.seatbid[ 0 ].bid[ 0 ].cur || rtbResponse.cur || 'USD');
expect(ad0.ad).to.be.an('undefined');
expect(ad0.vastXml).to.equal(rtbResponse.seatbid[ 0 ].bid[ 0 ].adm);
expect(ad0.vastUrl).to.equal(rtbResponse.seatbid[ 0 ].bid[ 0 ].ext.vast_url);

expect(ad1.requestId).to.equal(videoBidRequest.bidId);
expect(ad1.cpm).to.equal(rtbResponse.seatbid[ 1 ].bid[ 0 ].price);
Expand All @@ -317,6 +319,7 @@ describe('GambidAdapter', () => {
expect(ad1.currency).to.equal(rtbResponse.seatbid[ 1 ].bid[ 0 ].cur || rtbResponse.cur || 'USD');
expect(ad1.ad).to.be.an('undefined');
expect(ad1.vastXml).to.equal(rtbResponse.seatbid[ 1 ].bid[ 0 ].adm);
expect(ad1.vastUrl).to.equal(rtbResponse.seatbid[ 1 ].bid[ 0 ].ext.vast_url);
});
it('aggregates user-sync pixels', () => {
const response = spec.getUserSyncs({}, [ { body: rtbResponse } ]);
Expand Down

0 comments on commit eb9ad72

Please sign in to comment.