Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yieldmo adapter: add support of ATS envelope #14

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion modules/yieldmoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ export const spec = {
if (request.schain) {
serverRequest.schain = JSON.stringify(request.schain);
}
if (utils.deepAccess(request, 'params.lr_env')) {
serverRequest.ats_envelope = request.params.lr_env;
}
});
serverRequest.p = '[' + serverRequest.p.toString() + ']';

Expand Down Expand Up @@ -322,7 +325,8 @@ function openRtbRequest(bidRequests, bidderRequest) {
bcat: bidRequests[0].params.bcat || [],
ext: {
prebid: '$prebid.version$',
}
},
ats_envelope: bidRequests[0].params.lr_env,
};

populateOpenRtbGdpr(openRtbRequest, bidderRequest);
Expand Down
13 changes: 8 additions & 5 deletions modules/yieldmoBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ var adUnits = [{ // Banner adUnit
bids: [{
bidder: 'yieldmo',
params: {
placementId: '1779781193098233305', // string with at most 19 characters (may include numbers only)
bidFloor: .28 // optional param
placementId: '1779781193098233305', // string with at most 19 characters (may include numbers only)
bidFloor: .28, // optional param
lr_env: '***' // Optional. Live Ramp ATS envelope
}
}]
}];
Expand Down Expand Up @@ -64,7 +65,8 @@ var adUnits = [{ // Video adUnit
playbackmethod: [2,6], // required, array of integers
skippable: true, // optional, boolean
skipafter: 10 // optional, integer
}
},
lr_env: '***' // Optional. Live Ramp ATS envelope
}
}]
}];
Expand All @@ -91,13 +93,14 @@ var videoAdUnit = [{
protocols: [2, 3], // required, array of integers
api: [2, 3], // required, array of integers
playbackmethod: [1,2] // required, array of integers
}
},
lr_env: '***' // Optional. Live Ramp ATS envelope
}
}]
}];
```

Please also note, that we support the following OpenRTB params:
Please also note, that we support the following OpenRTB params:
'mimes', 'startdelay', 'placement', 'startdelay', 'skipafter', 'protocols', 'api',
'playbackmethod', 'maxduration', 'minduration', 'pos', 'skip', 'skippable'.
They can be specified in `mediaTypes.video` or in `bids[].params.video`.
14 changes: 14 additions & 0 deletions test/spec/modules/yieldmoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,20 @@ describe('YieldmoAdapter', function () {
const requests = build([mockVideoBid()]);
expect(requests[0].data.imp[0].bidfloor).to.equal(0);
});

it('should add ats_envelope to video bid request', function() {
const envelope = 'test_envelope';
const requests = build([mockVideoBid({}, { lr_env: envelope })]);

expect(requests[0].data.ats_envelope).to.equal(envelope);
});

it('should add ats_envelope to banner bid request', function() {
const envelope = 'test_envelope';
const requests = build([mockBannerBid({}, { lr_env: envelope })]);

expect(requests[0].data.ats_envelope).to.equal(envelope);
});
});
});

Expand Down