Skip to content

Commit

Permalink
OpenX Adapter: Fixed a bug where video requests do not have a bidder …
Browse files Browse the repository at this point in the history
…configuration code. (#3021)
  • Loading branch information
jimee02 authored and snapwich committed Aug 27, 2018
1 parent ce1ea59 commit d7f3f90
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/openxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {parse} from 'src/url';
const SUPPORTED_AD_TYPES = [BANNER, VIDEO];
const BIDDER_CODE = 'openx';
const BIDDER_CONFIG = 'hb_pb';
const BIDDER_VERSION = '2.1.3';
const BIDDER_VERSION = '2.1.4';

let shouldSendBoPixel = true;

Expand Down Expand Up @@ -201,6 +201,7 @@ function buildCommonQueryParamsFromBids(bids, bidderRequest) {
tz: new Date().getTimezoneOffset(),
tws: getViewportDimensions(isInIframe),
be: 1,
bc: bids[0].params.bc || `${BIDDER_CONFIG}_${BIDDER_VERSION}`,
dddid: utils._map(bids, bid => bid.transactionId).join(','),
nocache: new Date().getTime()
};
Expand Down Expand Up @@ -230,7 +231,6 @@ function buildOXBannerRequest(bids, bidderRequest) {
let queryParams = buildCommonQueryParamsFromBids(bids, bidderRequest);
let auids = utils._map(bids, bid => bid.params.unit);
queryParams.aus = utils._map(bids, bid => utils.parseSizesInput(bid.sizes).join(',')).join('|');
queryParams.bc = bids[0].params.bc || `${BIDDER_CONFIG}_${BIDDER_VERSION}`;
queryParams.divIds = utils._map(bids, bid => encodeURIComponent(bid.adUnitCode)).join(',');

if (auids.some(auid => auid)) {
Expand Down
7 changes: 7 additions & 0 deletions test/spec/modules/openxBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,13 @@ describe('OpenxAdapter', () => {
expect(dataParams.vwd).to.equal(640);
});

it('should send a bc parameter', () => {
const request = spec.buildRequests(bidRequestsWithMediaTypes);
const dataParams = request[0].data;

expect(dataParams.bc).to.have.string('hb_pb');
});

describe('when using the video param', function () {
let videoBidRequest;

Expand Down

0 comments on commit d7f3f90

Please sign in to comment.