-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCF v2.0 Purpose 2 Enforcement #5185
Conversation
modules/gdprEnforcement.js
Outdated
let isAllowed = false; | ||
if (!rule.vendorExceptions) rule.vendorExceptions = []; | ||
if (rule.enforcePurpose && rule.enforceVendor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just about to make a code change to fix this issue, where if one of these was set to false it never got in the checks!
Looks like this is the way to go instead of first checking for existence of the keys themselves.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, couple of minor points.
Can you also test for prebid server integration. Here is the page https://github.com/prebid/Prebid.js/blob/master/integrationExamples/gpt/prebidServer_example.html
modules/gdprEnforcement.js
Outdated
const isAllowed = validateRules(purpose2Rule, consentData, 2, currBidder, gvlId); | ||
if (!isAllowed) { | ||
utils.logWarn(`User blocked bidder: ${currBidder}. No bid request will be sent to their endpoint.`); | ||
// Emit an event for the Analytics adapters to listen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is unnecessary, below line of code is self explainatory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed comment.
modules/gdprEnforcement.js
Outdated
|
||
const purpose1 = 'storage'; | ||
const PURPOSE_1 = 'storage'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion:
I think it would be better if make this an object and keep the id 1 and name storage together.
const PURPOSE_1 = {
id: 1,
name: 'storage',
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I felt the same way that I'll be better to store the values as an object. I've made the change. Please have a look.
I've tested with prebidServer, seems to be working. |
We're discussing the defaults for Purpose 2... hold off a bit on merging |
We need to update this PR as noted in #5194
|
Removed this ticket from "on hold". Let me know if you'd like to walk through the changes in the document. FYI - I added a flowchart for the PBJS behavior at https://docs.google.com/document/d/1fBRaodKifv1pYsWY3ia-9K96VHUjd8kKvxZlOsozm8E/edit#heading=h.kasvbru2nwfh |
Type of change
Description of change
This PR introduces TCF v2.0 Purpose 2 (basicAds) enforcement feature to Prebid.js. This builds upon this PR, #5018
The basic idea is, if consent is not present for a bidder, the bidder won't send a request to their endpoint. A console warning message will be logged, and an event will be emitted for analytics adapters to consume.