Skip to content
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

Closed
wants to merge 16 commits into from
Closed

TCF v2.0 Purpose 2 Enforcement #5185

wants to merge 16 commits into from

Conversation

Fawke
Copy link
Contributor

@Fawke Fawke commented Apr 30, 2020

Type of change

  • Feature

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.

let isAllowed = false;
if (!rule.vendorExceptions) rule.vendorExceptions = [];
if (rule.enforcePurpose && rule.enforceVendor) {
Copy link
Collaborator

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!

Copy link
Collaborator

@jaiminpanchal27 jaiminpanchal27 left a 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

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
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed comment.


const purpose1 = 'storage';
const PURPOSE_1 = 'storage';
Copy link
Collaborator

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',
}

Copy link
Contributor Author

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.

@Fawke
Copy link
Contributor Author

Fawke commented May 7, 2020

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

I've tested with prebidServer, seems to be working.

@jaiminpanchal27 jaiminpanchal27 added LGTM needs 2nd review Core module updates require two approvals from the core team labels May 11, 2020
@Fawke Fawke mentioned this pull request May 13, 2020
1 task
@bretg bretg added the on hold label May 14, 2020
@bretg
Copy link
Collaborator

bretg commented May 14, 2020

We're discussing the defaults for Purpose 2... hold off a bit on merging

@bretg
Copy link
Collaborator

bretg commented May 20, 2020

We need to update this PR as noted in #5194

  • Prebid.js will block head bidding auctions if there's no legal basis test for Purpose 2, including legitmate interest established
  • Prebid.js will default to enforcing Purposes 1 and 2 if those rules aren't defined.
  • the allowAuctionWithoutConsent option should not be part of the TCF2 flow

@bretg bretg removed the on hold label May 22, 2020
@bretg
Copy link
Collaborator

bretg commented May 22, 2020

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

@bretg bretg added needs update and removed LGTM needs 2nd review Core module updates require two approvals from the core team labels May 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants