Skip to content

Commit

Permalink
Add COPPA compliance check in bid request data (#12190)
Browse files Browse the repository at this point in the history
- Extract COPPA flag from bidder request using deepAccess.
- Ensure COPPA flag is included in the request payload for compliance.
  • Loading branch information
hellyalpern authored Aug 29, 2024
1 parent 14b3b35 commit acdeb27
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 15 deletions.
3 changes: 2 additions & 1 deletion libraries/vidazooUtils/bidderUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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,
Expand Down
9 changes: 6 additions & 3 deletions test/spec/modules/illuminBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ const BIDDER_REQUEST = {
},
'regs': {
'gpp': 'gpp_string',
'gpp_sid': [7]
'gpp_sid': [7],
'coppa': 0
},
'device': {
'sua': {
Expand Down Expand Up @@ -339,7 +340,8 @@ describe('IlluminBidAdapter', function () {
contentLang: 'en',
isStorageAllowed: true,
pagecat: [],
userData: []
userData: [],
coppa: 0
}
});
});
Expand Down Expand Up @@ -406,7 +408,8 @@ describe('IlluminBidAdapter', function () {
contentLang: 'en',
isStorageAllowed: true,
pagecat: [],
userData: []
userData: [],
coppa: 0
}
});
});
Expand Down
9 changes: 6 additions & 3 deletions test/spec/modules/kueezRtbBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ const BIDDER_REQUEST = {
},
'regs': {
'gpp': 'gpp_string',
'gpp_sid': [7]
'gpp_sid': [7],
'coppa': 0
},
'device': {
'sua': {
Expand Down Expand Up @@ -336,7 +337,8 @@ describe('KueezRtbBidAdapter', function () {
contentData: [],
isStorageAllowed: true,
pagecat: [],
userData: []
userData: [],
coppa: 0
}
});
});
Expand Down Expand Up @@ -403,7 +405,8 @@ describe('KueezRtbBidAdapter', function () {
contentData: [],
isStorageAllowed: true,
pagecat: [],
userData: []
userData: [],
coppa: 0
}
});
});
Expand Down
9 changes: 6 additions & 3 deletions test/spec/modules/shinezRtbBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ const BIDDER_REQUEST = {
},
'regs': {
'gpp': 'gpp_string',
'gpp_sid': [7]
'gpp_sid': [7],
'coppa': 0
},
'device': {
'sua': {
Expand Down Expand Up @@ -341,7 +342,8 @@ describe('ShinezRtbBidAdapter', function () {
contentData: [],
isStorageAllowed: true,
pagecat: [],
userData: []
userData: [],
coppa: 0
}
});
});
Expand Down Expand Up @@ -408,7 +410,8 @@ describe('ShinezRtbBidAdapter', function () {
contentData: [],
isStorageAllowed: true,
pagecat: [],
userData: []
userData: [],
coppa: 0
}
});
});
Expand Down
9 changes: 6 additions & 3 deletions test/spec/modules/tagorasBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ const BIDDER_REQUEST = {
},
'regs': {
'gpp': 'gpp_string',
'gpp_sid': [7]
'gpp_sid': [7],
'coppa': 0
},
'device': {
'sua': {
Expand Down Expand Up @@ -338,7 +339,8 @@ describe('TagorasBidAdapter', function () {
contentData: [],
isStorageAllowed: true,
pagecat: [],
userData: []
userData: [],
coppa: 0
}
});
});
Expand Down Expand Up @@ -404,7 +406,8 @@ describe('TagorasBidAdapter', function () {
contentData: [],
isStorageAllowed: true,
pagecat: [],
userData: []
userData: [],
coppa: 0
}
});
});
Expand Down
6 changes: 5 additions & 1 deletion test/spec/modules/twistDigitalBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ const BIDDER_REQUEST = {
},
'regs': {
'gpp': 'gpp_string',
'gpp_sid': [7]
'gpp_sid': [7],
'coppa': 0
},
'device': {
'sua': {
Expand Down Expand Up @@ -339,6 +340,7 @@ describe('TwistDigitalBidAdapter', function () {
'architecture': ''
},
contentLang: 'en',
coppa: 0,
contentData: [{
'name': 'example.com',
'ext': {
Expand Down Expand Up @@ -441,6 +443,7 @@ describe('TwistDigitalBidAdapter', function () {
cat: ['IAB2'],
pagecat: ['IAB2-2'],
contentLang: 'en',
coppa: 0,
contentData: [{
'name': 'example.com',
'ext': {
Expand Down Expand Up @@ -528,6 +531,7 @@ describe('TwistDigitalBidAdapter', function () {
cat: ['IAB2'],
pagecat: ['IAB2-2'],
contentLang: 'en',
coppa: 0,
contentData: [{
'name': 'example.com',
'ext': {
Expand Down
6 changes: 5 additions & 1 deletion test/spec/modules/vidazooBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ const BIDDER_REQUEST = {
},
'regs': {
'gpp': 'gpp_string',
'gpp_sid': [7]
'gpp_sid': [7],
'coppa': 0
},
'device': {
'sua': {
Expand Down Expand Up @@ -344,6 +345,7 @@ describe('VidazooBidAdapter', function () {
'architecture': ''
},
contentLang: 'en',
coppa: 0,
contentData: [{
'name': 'example.com',
'ext': {
Expand Down Expand Up @@ -453,6 +455,7 @@ describe('VidazooBidAdapter', function () {
cat: ['IAB2'],
pagecat: ['IAB2-2'],
contentLang: 'en',
coppa: 0,
contentData: [{
'name': 'example.com',
'ext': {
Expand Down Expand Up @@ -545,6 +548,7 @@ describe('VidazooBidAdapter', function () {
cat: ['IAB2'],
pagecat: ['IAB2-2'],
contentLang: 'en',
coppa: 0,
contentData: [{
'name': 'example.com',
'ext': {
Expand Down

0 comments on commit acdeb27

Please sign in to comment.