From 9bf7c139c9ed05632b8a9802bbcf43d66e0db05b Mon Sep 17 00:00:00 2001 From: Aus Gomez Date: Tue, 31 Oct 2023 00:20:23 -0500 Subject: [PATCH 1/7] getConfig cleanup of device Revert "getConfig cleanup of device" This reverts commit 8cda77848adee6110e831a3064c3fa5f12367a87. From 0c70b10ea0832fa8d4c2241c1f6ea0f2dfcedbe1 Mon Sep 17 00:00:00 2001 From: Aus Gomez Date: Tue, 31 Oct 2023 00:25:57 -0500 Subject: [PATCH 2/7] getConfig-fix-for-device --- modules/insticatorBidAdapter.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/insticatorBidAdapter.js b/modules/insticatorBidAdapter.js index c770ac69dbe..a18c893b5fc 100644 --- a/modules/insticatorBidAdapter.js +++ b/modules/insticatorBidAdapter.js @@ -106,8 +106,10 @@ function buildImpression(bidRequest) { return imp; } -function buildDevice() { - const deviceConfig = config.getConfig('device'); +function buildDevice(bidRequest) { + const ortb2Data = bidRequest?.ortb2 || {}; + const deviceConfig = ortb2Data?.device || {} + const device = { w: window.innerWidth, h: window.innerHeight, @@ -184,7 +186,7 @@ function buildRequest(validBidRequests, bidderRequest) { page: bidderRequest.refererInfo.page, ref: bidderRequest.refererInfo.ref, }, - device: buildDevice(), + device: buildDevice(bidderRequest), regs: buildRegs(bidderRequest), user: buildUser(validBidRequests[0]), imp: validBidRequests.map((bidRequest) => buildImpression(bidRequest)), From 542cfc9d13a65d462ea6725189a2b2398b27ef37 Mon Sep 17 00:00:00 2001 From: Aus Gomez Date: Tue, 31 Oct 2023 00:33:33 -0500 Subject: [PATCH 3/7] Update aidemBidAdapter.js --- modules/aidemBidAdapter.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/aidemBidAdapter.js b/modules/aidemBidAdapter.js index c6a5cd96fb6..1d188469ccb 100644 --- a/modules/aidemBidAdapter.js +++ b/modules/aidemBidAdapter.js @@ -59,7 +59,7 @@ const converter = ortbConverter({ const request = buildRequest(imps, bidderRequest, context); deepSetValue(request, 'at', 1); setPrebidRequestEnvironment(request); - deepSetValue(request, 'regs', getRegs()); + deepSetValue(request, 'regs', getRegs(bidderRequest)); deepSetValue(request, 'site.publisher.id', bidderRequest.bids[0].params.publisherId); deepSetValue(request, 'site.id', bidderRequest.bids[0].params.siteId); return request; @@ -106,9 +106,11 @@ function recur(obj) { return result; } -function getRegs() { +function getRegs(bidRequest) { + const ortb2Data = bidRequest?.ortb2 || {}; + let regs = {}; - const consentManagement = config.getConfig('consentManagement'); + const consentManagement = ortb2Data.consentManagement || {}; const coppa = config.getConfig('coppa'); if (consentManagement && !!(consentManagement.gdpr)) { deepSetValue(regs, 'gdpr_applies', !!consentManagement.gdpr); From b99d828636dcbc8cee8bc7f7029709780edb02ae Mon Sep 17 00:00:00 2001 From: Aus Gomez Date: Tue, 31 Oct 2023 00:41:31 -0500 Subject: [PATCH 4/7] ortb2Data to apstreamBidAdapter.js --- modules/apstreamBidAdapter.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/apstreamBidAdapter.js b/modules/apstreamBidAdapter.js index 2856fb02087..bd45371412d 100644 --- a/modules/apstreamBidAdapter.js +++ b/modules/apstreamBidAdapter.js @@ -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 || @@ -305,7 +309,7 @@ function getConsentStringFromPrebid(gdprConsentConfig) { function getIabConsentString(bidderRequest) { if (deepAccess(bidderRequest, 'gdprConsent')) { - return getConsentStringFromPrebid(bidderRequest.gdprConsent); + return getConsentStringFromPrebid(bidderRequest); } return 'disabled'; From 8732a50c89708dd333794a83dcc1badc3e387126 Mon Sep 17 00:00:00 2001 From: Aus Gomez Date: Tue, 31 Oct 2023 01:06:45 -0500 Subject: [PATCH 5/7] Update madvertiseBidAdapter.js --- modules/madvertiseBidAdapter.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/madvertiseBidAdapter.js b/modules/madvertiseBidAdapter.js index 457ff2409b8..d23a7735bb2 100644 --- a/modules/madvertiseBidAdapter.js +++ b/modules/madvertiseBidAdapter.js @@ -34,6 +34,9 @@ export const spec = { * @return ServerRequest[] */ buildRequests: function (bidRequests, bidderRequest) { + const ortb2Data = bidRequests?.ortb2 || {}; + const consentManagement = ortb2Data?.consentManagement || {}; + return bidRequests.map(bidRequest => { bidRequest.startTime = new Date().getTime(); @@ -53,7 +56,7 @@ export const spec = { } if (bidderRequest && bidderRequest.gdprConsent) { - src = src + '&gdpr=' + (bidderRequest.gdprConsent.gdprApplies ? '1' : '0') + '&consent[0][format]=' + config.getConfig('consentManagement.cmpApi') + '&consent[0][value]=' + bidderRequest.gdprConsent.consentString; + src = src + '&gdpr=' + (bidderRequest.gdprConsent.gdprApplies ? '1' : '0') + '&consent[0][format]=' + consentManagement?.cmpApi + '&consent[0][value]=' + bidderRequest.gdprConsent.consentString; } return { From 13d62e3ead0af6c0915b622ec9c45568ccaf9c44 Mon Sep 17 00:00:00 2001 From: Aus Gomez Date: Tue, 31 Oct 2023 01:07:22 -0500 Subject: [PATCH 6/7] Update madvertiseBidAdapter.js --- modules/madvertiseBidAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/madvertiseBidAdapter.js b/modules/madvertiseBidAdapter.js index d23a7735bb2..2e9d0d3ca4f 100644 --- a/modules/madvertiseBidAdapter.js +++ b/modules/madvertiseBidAdapter.js @@ -34,7 +34,7 @@ export const spec = { * @return ServerRequest[] */ buildRequests: function (bidRequests, bidderRequest) { - const ortb2Data = bidRequests?.ortb2 || {}; + const ortb2Data = bidderRequest?.ortb2 || {}; const consentManagement = ortb2Data?.consentManagement || {}; return bidRequests.map(bidRequest => { From 9c2324b167ce942ac628d85b588a129b6652316f Mon Sep 17 00:00:00 2001 From: Chris Huie Date: Tue, 31 Oct 2023 07:36:29 -0700 Subject: [PATCH 7/7] remove config import --- modules/madvertiseBidAdapter.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/madvertiseBidAdapter.js b/modules/madvertiseBidAdapter.js index 2e9d0d3ca4f..82497847b64 100644 --- a/modules/madvertiseBidAdapter.js +++ b/modules/madvertiseBidAdapter.js @@ -1,5 +1,4 @@ import { parseSizesInput, _each } from '../src/utils.js'; -import {config} from '../src/config.js'; import {registerBidder} from '../src/adapters/bidderFactory.js'; // use protocol relative urls for http or https