Skip to content

Commit

Permalink
ortb2Data to apstreamBidAdapter.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ausgomez committed Oct 31, 2023
1 parent 51375d4 commit aefdb98
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions modules/apstreamBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,17 @@ function getRawConsentString(gdprConsentConfig) {
return gdprConsentConfig.consentString;
}

function getConsentStringFromPrebid(gdprConsentConfig) {
function getConsentStringFromPrebid(bidderRequest) {
const { gdprConsentConfig } = bidderRequest;
const consentString = getRawConsentString(gdprConsentConfig);
if (!consentString) {
return null;
}

let isIab = config.getConfig('consentManagement.cmpApi') != 'static';
const ortb2Data = bidderRequest?.ortb2 || {};
const consentManagement = ortb2Data?.consentManagement || {};

let isIab = consentManagement?.cmpApi != 'static';
let vendorConsents = (
gdprConsentConfig.vendorData.vendorConsents ||
(gdprConsentConfig.vendorData.vendor || {}).consents ||
Expand All @@ -305,7 +309,7 @@ function getConsentStringFromPrebid(gdprConsentConfig) {

function getIabConsentString(bidderRequest) {
if (deepAccess(bidderRequest, 'gdprConsent')) {
return getConsentStringFromPrebid(bidderRequest.gdprConsent);
return getConsentStringFromPrebid(bidderRequest);
}

return 'disabled';
Expand Down

0 comments on commit aefdb98

Please sign in to comment.