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

prebid Server Bid Adapter: added ortb2Imp.instl support #8040

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
5 changes: 5 additions & 0 deletions modules/prebidServerBidAdapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,11 @@ Object.assign(ORTB2.prototype, {

Object.assign(imp, mediaTypes);

const instl = deepAccess(adUnit, 'ortb2Imp.instl');
if (instl) {
imp.instl = instl;
}

// if storedAuctionResponse has been set, pass SRID
const storedAuctionResponseBid = find(firstBidRequest.bids, bid => (bid.adUnitCode === adUnit.code && bid.storedAuctionResponse));
if (storedAuctionResponseBid) {
Expand Down
17 changes: 17 additions & 0 deletions test/spec/modules/prebidServerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,23 @@ describe('S2S Adapter', function () {
expect(parsedRequestBody.bcat).to.deep.equal(bcat);
});

it('should set imp.instl if ortb2Imp.instl is present', function() {
const consentConfig = { s2sConfig: CONFIG };
config.setConfig(consentConfig);
const bidRequest = utils.deepClone(REQUEST);
bidRequest.ad_units[0].ortb2Imp = {
instl: 1
};

adapter.callBids(bidRequest, BID_REQUESTS, addBidResponse, done, ajax);
const parsedRequestBody = JSON.parse(server.requests[0].requestBody);

expect(parsedRequestBody.imp).to.be.a('array');
expect(parsedRequestBody.imp[0]).to.be.a('object');
expect(parsedRequestBody.imp[0]).to.have.property('instl');
expect(parsedRequestBody.imp[0].instl).to.equal(1);
});

describe('pbAdSlot config', function () {
it('should not send \"imp.ext.data.pbadslot\" if \"ortb2Imp.ext\" is undefined', function () {
const consentConfig = { s2sConfig: CONFIG };
Expand Down