Skip to content

Commit

Permalink
TTD Bid Adapter: add support for regs.gpp (#9274)
Browse files Browse the repository at this point in the history
* Update ttdBidAdapter.js

* Update ttdBidAdapter.js

* Update ttdBidAdapter_spec.js

* Update ttdBidAdapter_spec.js

* Update ttdBidAdapter_spec.js

* fix linting

* Update ttdBidAdapter_spec.js

* Update ttdBidAdapter_spec.js

* Update ttdBidAdapter.js

* Update ttdBidAdapter_spec.js

* Update ttdBidAdapter.js

* Update ttdBidAdapter.js

* Update ttdBidAdapter.js

* Update ttdBidAdapter.js

* Update ttdBidAdapter.js

* Update ttdBidAdapter.js

* Update ttdBidAdapter.js

Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>
  • Loading branch information
patmmccann and ChrisHuie authored Nov 29, 2022
1 parent dd7d8a6 commit 29c0d82
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
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

0 comments on commit 29c0d82

Please sign in to comment.