Skip to content

Commit

Permalink
Cadent Aperture MX Bid Adapter: support GPP and GPP Section Ids (#10342)
Browse files Browse the repository at this point in the history
* added gpp support and test cases

* code review changes to tests and syntax

* cosmetic change

---------

Co-authored-by: Murtaza Haji <[email protected]>
Co-authored-by: Michael Denton <[email protected]>
  • Loading branch information
3 people committed Aug 15, 2023
1 parent 507b5a0 commit 309f979
Show file tree
Hide file tree
Showing 2 changed files with 285 additions and 198 deletions.
17 changes: 17 additions & 0 deletions modules/cadentApertureMXBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,22 @@ export const cadentAdapter = {

return cadentData;
},

getGpp: (bidRequest, cadentData) => {
if (bidRequest.gppConsent) {
const {gppString: gpp, applicableSections: gppSid} = bidRequest.gppConsent;
if (cadentData.regs) {
cadentData.regs.gpp = gpp;
cadentData.regs.gpp_sid = gppSid;
} else {
cadentData.regs = {
gpp: gpp,
gpp_sid: gppSid
}
}
}
return cadentData;
},
getSupplyChain: (bidderRequest, cadentData) => {
if (bidderRequest.bids[0] && bidderRequest.bids[0].schain) {
cadentData.source = {
Expand Down Expand Up @@ -290,6 +306,7 @@ export const spec = {
};

cadentData = cadentAdapter.getGdpr(bidderRequest, Object.assign({}, cadentData));
cadentData = cadentAdapter.getGpp(bidderRequest, Object.assign({}, cadentData));
cadentData = cadentAdapter.getSupplyChain(bidderRequest, Object.assign({}, cadentData));
if (bidderRequest && bidderRequest.uspConsent) {
cadentData.us_privacy = bidderRequest.uspConsent;
Expand Down
Loading

0 comments on commit 309f979

Please sign in to comment.