Skip to content

Commit

Permalink
Admixer Bid Adapter add consent support (prebid#5169)
Browse files Browse the repository at this point in the history
* add gdpr and usp

Co-authored-by: atkachov <[email protected]>
  • Loading branch information
2 people authored and Jimmy Tu committed Jun 12, 2020
1 parent ae0041f commit ab92f41
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion modules/admixerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,22 @@ export const spec = {
buildRequests: function (validRequest, bidderRequest) {
const payload = {
imps: [],
referrer: encodeURIComponent(bidderRequest.refererInfo.referer),
};
if (bidderRequest) {
if (bidderRequest.refererInfo && bidderRequest.refererInfo.referer) {
payload.referrer = encodeURIComponent(bidderRequest.refererInfo.referer);
}
if (bidderRequest.gdprConsent) {
payload.gdprConsent = {
consentString: bidderRequest.gdprConsent.consentString,
// will check if the gdprApplies field was populated with a boolean value (ie from page config). If it's undefined, then default to true
gdprApplies: (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : true
}
}
if (bidderRequest.uspConsent) {
payload.uspConsent = bidderRequest.uspConsent;
}
}
validRequest.forEach((bid) => {
payload.imps.push(bid);
});
Expand Down

0 comments on commit ab92f41

Please sign in to comment.