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

TTD Bid Adapter: add support for regs.gpp #9274

Merged
merged 17 commits into from
Nov 29, 2022
Merged
4 changes: 4 additions & 0 deletions modules/ttdBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ function getRegs(bidderRequest) {
if (config.getConfig('coppa') === true) {
regs.coppa = 1;
}
if (bidderRequest.ortb2?.regs) {
utils.mergeDeep(regs, bidderRequest.ortb2.regs);
}

return regs;
}

Expand Down
14 changes: 14 additions & 0 deletions test/spec/modules/ttdBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,20 @@ describe('ttdBidAdapter', function () {
expect(requestBody.regs.coppa).to.equal(1);
});

it('adds gpp consent info to the request', function () {
const ortb2 = {
regs: {
gpp: 'somegppstring',
gpp_sid: [6, 7]
}
};
let clonedBidderRequest = {...deepClone(baseBidderRequest), ortb2};
const requestBody = testBuildRequests(baseBannerBidRequests, clonedBidderRequest).data;
config.resetConfig();
expect(requestBody.regs.gpp).to.equal('somegppstring');
expect(requestBody.regs.gpp_sid).to.eql([6, 7]);
});

it('adds schain info to the request', function () {
const schain = {
'ver': '1.0',
Expand Down