From b5842ebb02472553d670cfe834d763ffa73f3b79 Mon Sep 17 00:00:00 2001 From: Arik Kfir Date: Tue, 10 Jul 2018 18:32:15 +0300 Subject: [PATCH] Gambid adapter: Provide "mediaType" for all bids, and "vastUrl" property for video bids (#2825) --- modules/gambidBidAdapter.js | 6 +++--- test/spec/modules/gambidBidAdapter_spec.js | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/gambidBidAdapter.js b/modules/gambidBidAdapter.js index e87c28acc77..ca711f6e1eb 100644 --- a/modules/gambidBidAdapter.js +++ b/modules/gambidBidAdapter.js @@ -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; diff --git a/test/spec/modules/gambidBidAdapter_spec.js b/test/spec/modules/gambidBidAdapter_spec.js index 54b9c518e2b..0498de8790e 100644 --- a/test/spec/modules/gambidBidAdapter_spec.js +++ b/test/spec/modules/gambidBidAdapter_spec.js @@ -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' } ] @@ -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); @@ -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 } ]);