Skip to content

Commit 159e13d

Browse files
kenan-gilletidettman
authored and
idettman
committed
OpenX Bid Adapter: Set Deal ID for video requests (#6573)
1 parent feba9c5 commit 159e13d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

modules/openxBidAdapter.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ function createVideoBidResponses(response, {bid, startTime}) {
440440
let vastQueryParams = utils.parseUrl(response.vastUrl).search || {};
441441
let bidResponse = {};
442442
bidResponse.requestId = bid.bidId;
443+
if (response.deal_id) {
444+
bidResponse.dealId = response.deal_id;
445+
}
443446
// default 5 mins
444447
bidResponse.ttl = 300;
445448
// true is net, false is gross

test/spec/modules/openxBidAdapter_spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,6 +1854,13 @@ describe('OpenxAdapter', function () {
18541854
expect(JSON.stringify(Object.keys(result[0]).sort())).to.eql(JSON.stringify(Object.keys(expectedResponse[0]).sort()));
18551855
});
18561856

1857+
it('should return correct bid response with MediaType and deal_id', function () {
1858+
const bidResponseOverride = { 'deal_id': 'OX-mydeal' };
1859+
const bidResponseWithDealId = Object.assign({}, bidResponse, bidResponseOverride);
1860+
const result = spec.interpretResponse({body: bidResponseWithDealId}, bidRequestsWithMediaType);
1861+
expect(result[0].dealId).to.equal(bidResponseOverride.deal_id);
1862+
});
1863+
18571864
it('should handle nobid responses for bidRequests with MediaTypes', function () {
18581865
const bidResponse = {'vastUrl': '', 'pub_rev': '', 'width': '', 'height': '', 'adid': '', 'pixels': ''};
18591866
const result = spec.interpretResponse({body: bidResponse}, bidRequestsWithMediaTypes);

0 commit comments

Comments
 (0)