Skip to content

Commit

Permalink
Merge pull request #1 from kusapan/feature/190228_add-params
Browse files Browse the repository at this point in the history
Feature/190228 add params
  • Loading branch information
kusapan authored Mar 5, 2019
2 parents 4aabe19 + ac774c0 commit 4b5aa1d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/yieldoneBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,23 @@ export const spec = {
const cb = Math.floor(Math.random() * 99999999999);
const referrer = encodeURIComponent(utils.getTopWindowUrl());
const bidId = bidRequest.bidId;
const unitCode = bidRequest.adUnitCode;
const payload = {
v: 'hb1',
p: placementId,
cb: cb,
r: referrer,
uid: bidId,
uc: unitCode,
t: 'i'
};

if (window.PREBID_TIMEOUT) {
payload.tmax = window.PREBID_TIMEOUT;
} else if (window.pbjsTimeout) {
payload.tmax = window.pbjsTimeout;
}

const videoMediaType = utils.deepAccess(bidRequest, 'mediaTypes.video');
if (bidRequest.mediaType === VIDEO || videoMediaType) {
const sizes = utils.deepAccess(bidRequest, 'mediaTypes.video.playerSize') || bidRequest.sizes;
Expand Down
5 changes: 5 additions & 0 deletions test/spec/modules/yieldoneBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ describe('yieldoneBidAdapter', function() {
expect(request[0].data.w).to.equal('300');
expect(request[0].data.h).to.equal('250');
});

it('adUnitCode should be sent as uc parameters on any requests', function () {
expect(request[0].data.uc).to.equal('adunit-code1');
expect(request[1].data.uc).to.equal('adunit-code2');
});
});

describe('interpretResponse', function () {
Expand Down

0 comments on commit 4b5aa1d

Please sign in to comment.