Skip to content

Commit

Permalink
Video and banner deal id (#8135)
Browse files Browse the repository at this point in the history
  • Loading branch information
ym-elber authored Mar 8, 2022
1 parent bcfaf8e commit e2eb950
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/yieldmoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ function addPlacement(request) {
*/
function createNewBannerBid(response) {
return {
dealId: response.publisherDealId,
requestId: response['callback_id'],
cpm: response.cpm,
width: response.width,
Expand All @@ -257,6 +258,7 @@ function createNewVideoBid(response, bidRequest) {
const imp = find((deepAccess(bidRequest, 'data.imp') || []), imp => imp.id === response.impid);

let result = {
dealId: response.dealid,
requestId: imp.id,
cpm: response.price,
width: imp.video.w,
Expand Down
4 changes: 4 additions & 0 deletions test/spec/modules/yieldmoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ describe('YieldmoAdapter', function () {
body: [{
callback_id: '21989fdbef550a',
cpm: 3.45455,
publisherDealId: 'YMO_123',
width: 300,
height: 250,
ad: '<html><head></head><body><script>//GEX ad object</script>' +
Expand All @@ -525,6 +526,7 @@ describe('YieldmoAdapter', function () {
const newResponse = spec.interpretResponse(mockServerResponse());
expect(newResponse.length).to.be.equal(1);
expect(newResponse[0]).to.deep.equal({
dealId: 'YMO_123',
requestId: '21989fdbef550a',
cpm: 3.45455,
width: 300,
Expand Down Expand Up @@ -552,6 +554,7 @@ describe('YieldmoAdapter', function () {
crid: 'dd65c0a7536aff',
impid: '91ea8bba1',
price: 1.5,
dealid: 'YMO_456'
},
},
];
Expand All @@ -574,6 +577,7 @@ describe('YieldmoAdapter', function () {
const newResponse = spec.interpretResponse(response, bidRequest);
expect(newResponse.length).to.be.equal(2);
expect(newResponse[1]).to.deep.equal({
dealId: 'YMO_456',
cpm: 1.5,
creativeId: 'dd65c0a7536aff',
currency: 'USD',
Expand Down

0 comments on commit e2eb950

Please sign in to comment.