-
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
TCFv2.0 Purpose 7 #5444
TCFv2.0 Purpose 7 #5444
Conversation
…nalytics adapters
Good work @Fawke - my take is that your minimal analytics proposal is fine:
Analytics adapters can But will allow analytics providers to weigh in. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
docs PR prebid/prebid.github.io#2192 |
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.
Code looks good.
I will be submitting a change to the Rubicon Analytics adapter alongside this to add our GVL ID, so will test it more thoroughly during that.
$$PREBID_GLOBAL$$.enableAnalytics = function (config) { | ||
|
||
// Stores 'enableAnalytics' callbacks for later execution. | ||
const enableAnalyticsCallbacks = []; |
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.
Awesome stuff 👍
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.
LGTM.
Can you add one more test for auction end emit event
@jaiminpanchal27 Added! |
* TCF v2.0 enforcement * test/spec/modules/gdprEnforcement_spec.js * add check for gdpr version * add logInfo message * remove comment and store value of PURPOSES in an object * add gvlid check * add unit tests for validateRules function * remove purposeId parameter from validateRules function * add extra tests * make failing unit test case pass * deprecate allowAuctionWithouConsent with tcf 2 workflow * add extra checks for defaults * remove tcf 2 test page * add strict gvlid check * add comments and shorten log messages * shorted log messages * add unit tests for setEnforcementConfig * add gvlid for alias and gvlMapping support * remove gvlid check * add support to add gvlid for aliases * add enableAnalytics hook * purpose 7 implementation: 1.hook added 2.new field to set gvlid for analytics adapters * add enableAnalytics hook * emit tcf2 events * fix regression * modify mechanism of event emitted after auction end * add unit test for enableAnalyticsHook * add unit test for auction end event Co-authored-by: Jaimin Panchal <[email protected]>
This reverts commit 13eae5b.
Type of change
Description of change
Introduces support to enforce TCFv2.0 Purpose 7 (measurement). For details on the spec, please refer to this doc.
Basically, the idea is to block the analytics adapter that are not given consent. In actual implementation terms, it translates to not calling the
enableAnalytics
function of theAnalyticsAdapter.js
interface.A way to specify GVL ID for Analytics Adapters.
An analytics adapter needs to be associated with a Gvl ID in order to participate in the enforcement checks. If Gvl ID is
undefined
, then the Analytics adapter will automatically be disqualified and blocked.Since, there is currently no specific way to provide Gvl ID for Analytics Adapters, this PR introduces a way to do so. When you are registering your analytics adapter in your
myAnalyticsAdapter.js
file, you can provide the GVL ID in the following way:Pass it as a property along with
adapter
andcode
.TCF2 Enforcement Results
An event,
tcf2Enforcement
will be emitted with the payload,which will contain information of all the necessary bidders and modules which are blocked by tcf2. One thing which this event payload does not capture is the enforcement status of Purpose 1, 2 and 7. Although, it can be derived from the payload above, for example, if biddersBlocked array is
[]
, that means purpose 2 is not enforced. But in some cases, it could be misleading. For examples, cases where even though purpose 2 is enforced, but all the bidders are given consent by the user or are present invendorExceptions
will give us an[]
. Let me know if this detail neccessary, I can modify the payload to look something like: