From acdeb2770c825b0f489e19424e558d2710172d78 Mon Sep 17 00:00:00 2001 From: Helly Alpern <157289260+hellyalpern@users.noreply.github.com> Date: Thu, 29 Aug 2024 15:42:31 +0300 Subject: [PATCH] Add COPPA compliance check in bid request data (#12190) - Extract COPPA flag from bidder request using deepAccess. - Ensure COPPA flag is included in the request payload for compliance. --- libraries/vidazooUtils/bidderUtils.js | 3 ++- test/spec/modules/illuminBidAdapter_spec.js | 9 ++++++--- test/spec/modules/kueezRtbBidAdapter_spec.js | 9 ++++++--- test/spec/modules/shinezRtbBidAdapter_spec.js | 9 ++++++--- test/spec/modules/tagorasBidAdapter_spec.js | 9 ++++++--- test/spec/modules/twistDigitalBidAdapter_spec.js | 6 +++++- test/spec/modules/vidazooBidAdapter_spec.js | 6 +++++- 7 files changed, 36 insertions(+), 15 deletions(-) diff --git a/libraries/vidazooUtils/bidderUtils.js b/libraries/vidazooUtils/bidderUtils.js index 9b1473b0c28..fbb4300cb24 100644 --- a/libraries/vidazooUtils/bidderUtils.js +++ b/libraries/vidazooUtils/bidderUtils.js @@ -245,8 +245,8 @@ export function buildRequestData(bid, topWindowUrl, sizes, bidderRequest, bidder const pagecat = deepAccess(bidderRequest, 'ortb2.site.pagecat', []); const contentData = deepAccess(bidderRequest, 'ortb2.site.content.data', []); const userData = deepAccess(bidderRequest, 'ortb2.user.data', []); - const contentLang = deepAccess(bidderRequest, 'ortb2.site.content.language') || document.documentElement.lang; + const coppa = deepAccess(bidderRequest, 'ortb2.regs.coppa', 0); if (isFn(bid.getFloor)) { const floorInfo = bid.getFloor({ @@ -281,6 +281,7 @@ export function buildRequestData(bid, topWindowUrl, sizes, bidderRequest, bidder cat: cat, contentData, contentLang, + coppa, userData: userData, pagecat: pagecat, transactionId: ortb2Imp?.ext?.tid, diff --git a/test/spec/modules/illuminBidAdapter_spec.js b/test/spec/modules/illuminBidAdapter_spec.js index 0e6e98c6f04..3cd79c7468d 100644 --- a/test/spec/modules/illuminBidAdapter_spec.js +++ b/test/spec/modules/illuminBidAdapter_spec.js @@ -114,7 +114,8 @@ const BIDDER_REQUEST = { }, 'regs': { 'gpp': 'gpp_string', - 'gpp_sid': [7] + 'gpp_sid': [7], + 'coppa': 0 }, 'device': { 'sua': { @@ -339,7 +340,8 @@ describe('IlluminBidAdapter', function () { contentLang: 'en', isStorageAllowed: true, pagecat: [], - userData: [] + userData: [], + coppa: 0 } }); }); @@ -406,7 +408,8 @@ describe('IlluminBidAdapter', function () { contentLang: 'en', isStorageAllowed: true, pagecat: [], - userData: [] + userData: [], + coppa: 0 } }); }); diff --git a/test/spec/modules/kueezRtbBidAdapter_spec.js b/test/spec/modules/kueezRtbBidAdapter_spec.js index 188fe005990..2df5e299aeb 100644 --- a/test/spec/modules/kueezRtbBidAdapter_spec.js +++ b/test/spec/modules/kueezRtbBidAdapter_spec.js @@ -111,7 +111,8 @@ const BIDDER_REQUEST = { }, 'regs': { 'gpp': 'gpp_string', - 'gpp_sid': [7] + 'gpp_sid': [7], + 'coppa': 0 }, 'device': { 'sua': { @@ -336,7 +337,8 @@ describe('KueezRtbBidAdapter', function () { contentData: [], isStorageAllowed: true, pagecat: [], - userData: [] + userData: [], + coppa: 0 } }); }); @@ -403,7 +405,8 @@ describe('KueezRtbBidAdapter', function () { contentData: [], isStorageAllowed: true, pagecat: [], - userData: [] + userData: [], + coppa: 0 } }); }); diff --git a/test/spec/modules/shinezRtbBidAdapter_spec.js b/test/spec/modules/shinezRtbBidAdapter_spec.js index 329a683938c..ebd2e987491 100644 --- a/test/spec/modules/shinezRtbBidAdapter_spec.js +++ b/test/spec/modules/shinezRtbBidAdapter_spec.js @@ -116,7 +116,8 @@ const BIDDER_REQUEST = { }, 'regs': { 'gpp': 'gpp_string', - 'gpp_sid': [7] + 'gpp_sid': [7], + 'coppa': 0 }, 'device': { 'sua': { @@ -341,7 +342,8 @@ describe('ShinezRtbBidAdapter', function () { contentData: [], isStorageAllowed: true, pagecat: [], - userData: [] + userData: [], + coppa: 0 } }); }); @@ -408,7 +410,8 @@ describe('ShinezRtbBidAdapter', function () { contentData: [], isStorageAllowed: true, pagecat: [], - userData: [] + userData: [], + coppa: 0 } }); }); diff --git a/test/spec/modules/tagorasBidAdapter_spec.js b/test/spec/modules/tagorasBidAdapter_spec.js index 53d71a1de78..6ebe2896ffc 100644 --- a/test/spec/modules/tagorasBidAdapter_spec.js +++ b/test/spec/modules/tagorasBidAdapter_spec.js @@ -114,7 +114,8 @@ const BIDDER_REQUEST = { }, 'regs': { 'gpp': 'gpp_string', - 'gpp_sid': [7] + 'gpp_sid': [7], + 'coppa': 0 }, 'device': { 'sua': { @@ -338,7 +339,8 @@ describe('TagorasBidAdapter', function () { contentData: [], isStorageAllowed: true, pagecat: [], - userData: [] + userData: [], + coppa: 0 } }); }); @@ -404,7 +406,8 @@ describe('TagorasBidAdapter', function () { contentData: [], isStorageAllowed: true, pagecat: [], - userData: [] + userData: [], + coppa: 0 } }); }); diff --git a/test/spec/modules/twistDigitalBidAdapter_spec.js b/test/spec/modules/twistDigitalBidAdapter_spec.js index a114b582083..c15a6d1d909 100644 --- a/test/spec/modules/twistDigitalBidAdapter_spec.js +++ b/test/spec/modules/twistDigitalBidAdapter_spec.js @@ -126,7 +126,8 @@ const BIDDER_REQUEST = { }, 'regs': { 'gpp': 'gpp_string', - 'gpp_sid': [7] + 'gpp_sid': [7], + 'coppa': 0 }, 'device': { 'sua': { @@ -339,6 +340,7 @@ describe('TwistDigitalBidAdapter', function () { 'architecture': '' }, contentLang: 'en', + coppa: 0, contentData: [{ 'name': 'example.com', 'ext': { @@ -441,6 +443,7 @@ describe('TwistDigitalBidAdapter', function () { cat: ['IAB2'], pagecat: ['IAB2-2'], contentLang: 'en', + coppa: 0, contentData: [{ 'name': 'example.com', 'ext': { @@ -528,6 +531,7 @@ describe('TwistDigitalBidAdapter', function () { cat: ['IAB2'], pagecat: ['IAB2-2'], contentLang: 'en', + coppa: 0, contentData: [{ 'name': 'example.com', 'ext': { diff --git a/test/spec/modules/vidazooBidAdapter_spec.js b/test/spec/modules/vidazooBidAdapter_spec.js index 2ca1c80ea47..14a49b21cdc 100644 --- a/test/spec/modules/vidazooBidAdapter_spec.js +++ b/test/spec/modules/vidazooBidAdapter_spec.js @@ -130,7 +130,8 @@ const BIDDER_REQUEST = { }, 'regs': { 'gpp': 'gpp_string', - 'gpp_sid': [7] + 'gpp_sid': [7], + 'coppa': 0 }, 'device': { 'sua': { @@ -344,6 +345,7 @@ describe('VidazooBidAdapter', function () { 'architecture': '' }, contentLang: 'en', + coppa: 0, contentData: [{ 'name': 'example.com', 'ext': { @@ -453,6 +455,7 @@ describe('VidazooBidAdapter', function () { cat: ['IAB2'], pagecat: ['IAB2-2'], contentLang: 'en', + coppa: 0, contentData: [{ 'name': 'example.com', 'ext': { @@ -545,6 +548,7 @@ describe('VidazooBidAdapter', function () { cat: ['IAB2'], pagecat: ['IAB2-2'], contentLang: 'en', + coppa: 0, contentData: [{ 'name': 'example.com', 'ext': {