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

Smaato Bid Adapter: pass through bidRequest.schain #7675

Merged
merged 1 commit into from
Nov 8, 2021
Merged
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
7 changes: 6 additions & 1 deletion modules/smaatoBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {ADPOD, BANNER, VIDEO} from '../src/mediaTypes.js';

const BIDDER_CODE = 'smaato';
const SMAATO_ENDPOINT = 'https://prebid.ad.smaato.net/oapi/prebid';
const SMAATO_CLIENT = 'prebid_js_$prebid.version$_1.4'
const SMAATO_CLIENT = 'prebid_js_$prebid.version$_1.5'
const CURRENCY = 'USD';

const buildOpenRtbBidRequest = (bidRequest, bidderRequest) => {
Expand Down Expand Up @@ -37,6 +37,11 @@ const buildOpenRtbBidRequest = (bidRequest, bidderRequest) => {
user: {
ext: {}
},
source: {
ext: {
schain: bidRequest.schain
}
},
ext: {
client: SMAATO_CLIENT
}
Expand Down
30 changes: 30 additions & 0 deletions test/spec/modules/smaatoBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ describe('smaatoBidAdapterTest', () => {
expect(req.regs.ext.us_privacy).to.equal('uspConsentString');
});

it('sends no schain if no schain exists', () => {
const reqs = spec.buildRequests([singleBannerBidRequest], defaultBidderRequest);

const req = extractPayloadOfFirstAndOnlyRequest(reqs);
expect(req.source.ext.schain).to.not.exist;
});

it('sends tmax', () => {
const reqs = spec.buildRequests([singleBannerBidRequest], defaultBidderRequest);

Expand Down Expand Up @@ -854,6 +861,29 @@ describe('smaatoBidAdapterTest', () => {
expect(req.user.ext.eids).to.have.length(2);
});
});

describe('schain in request', () => {
it('schain is added to source.ext.schain', () => {
const schain = {
ver: '1.0',
complete: 1,
nodes: [
{
'asi': 'asi',
'sid': 'sid',
'rid': 'rid',
'hp': 1
}
]
};
const bidRequestWithSchain = Object.assign({}, singleBannerBidRequest, {schain: schain});

const reqs = spec.buildRequests([bidRequestWithSchain], defaultBidderRequest);

const req = extractPayloadOfFirstAndOnlyRequest(reqs);
expect(req.source.ext.schain).to.deep.equal(schain);
});
});
});

describe('interpretResponse', () => {
Expand Down