From 2d1c3119016f7660583aef03a9a593fa031510f3 Mon Sep 17 00:00:00 2001 From: atsymuk Date: Mon, 21 Jun 2021 19:00:53 +0200 Subject: [PATCH] yieldmo adapter: add support of ATS envelope --- modules/yieldmoBidAdapter.js | 6 +++++- modules/yieldmoBidAdapter.md | 13 ++++++++----- test/spec/modules/yieldmoBidAdapter_spec.js | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/modules/yieldmoBidAdapter.js b/modules/yieldmoBidAdapter.js index fa1ab3a90b3..654e7236210 100644 --- a/modules/yieldmoBidAdapter.js +++ b/modules/yieldmoBidAdapter.js @@ -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() + ']'; @@ -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); diff --git a/modules/yieldmoBidAdapter.md b/modules/yieldmoBidAdapter.md index 040fbbec486..c98e2ab5c74 100644 --- a/modules/yieldmoBidAdapter.md +++ b/modules/yieldmoBidAdapter.md @@ -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 } }] }]; @@ -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 } }] }]; @@ -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`. diff --git a/test/spec/modules/yieldmoBidAdapter_spec.js b/test/spec/modules/yieldmoBidAdapter_spec.js index 77542480c6c..378c5d89113 100644 --- a/test/spec/modules/yieldmoBidAdapter_spec.js +++ b/test/spec/modules/yieldmoBidAdapter_spec.js @@ -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); + }); }); });