Skip to content

Commit

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

Co-authored-by: atkachov <atkachov91@admixer.ua>
  • Loading branch information
Galphimbl and atkachov authored May 6, 2020
1 parent 17e1d80 commit bb6cb10
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 bb6cb10

Please sign in to comment.