Skip to content

Commit

Permalink
Cadent Aperture MX Bid Adapter: support GPP and GPP Section Ids
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 authored Aug 9, 2023
1 parent 7a8c6f4 commit c3769d9
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 c3769d9

Please sign in to comment.