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

Reading TCF consent from within a module #3587

Closed
EskelCz opened this issue Feb 18, 2022 · 4 comments
Closed

Reading TCF consent from within a module #3587

EskelCz opened this issue Feb 18, 2022 · 4 comments

Comments

@EskelCz
Copy link
Contributor

EskelCz commented Feb 18, 2022

Regarding this segment: https://docs.prebid.org/dev-docs/integrate-with-the-prebid-analytics-api.html#reading-tcf2-enforcement-actions

The doc states that analytics adapter can listen for TCF events, but when I add an event listener for CONSTANTS.EVENTS.TCF2_ENFORCEMENT (had to look for it in the prebid codebase), it doesn't fire. I assume it should fire with every page load, but the docs are vague. I also tried getting all events before the module is loaded, still the event wasn't there either.

Can you please clarify when is the event fired and add a working example how to get the stated TCF consent information from within an analytics module?
Thank you.

@EskelCz
Copy link
Contributor Author

EskelCz commented Feb 18, 2022

Now I've noticed the event is being fired after auctionEnd. I don't think that's every useful. Is there a reason for it being fired so late? The consent should be finalised at the start of the auction, should it not?

Prebid MESSAGE: Emitting event for: auctionEnd
Prebid MESSAGE: Emitting event for: tcf2Enforcement

@bretg
Copy link
Contributor

bretg commented Feb 23, 2022

Sorry @EskelCz - this is the documentation repo and this issue seems to be code-related. Adding @Fawke who I believe was involved in the development of the GDPR module.

@bretg
Copy link
Contributor

bretg commented Feb 24, 2022

The code is pretty clear on this. From https://github.com/prebid/Prebid.js/blob/81eae0b8ad3bf1fabfb606166734b425fdd98751/modules/gdprEnforcement.js

  const tcf2FinalResults = {
    storageBlocked: formatArray(storageBlocked),
    biddersBlocked: formatArray(biddersBlocked),
    analyticsBlocked: formatArray(analyticsBlocked)
  };

  events.emit(CONSTANTS.EVENTS.TCF2_ENFORCEMENT, tcf2FinalResults);
}

events.on(CONSTANTS.EVENTS.AUCTION_END, emitTCF2FinalResults);

This is meant to be an after-the-fact accounting of which modules were blocked for various reasons. What is it you're looking for? The title is "reading TCF consent within a module". Other analytics adapters (e.g. https://github.com/prebid/Prebid.js/blob/master/modules/rubiconAnalyticsAdapter.js) read consent data - please search for 'consent' there. Also, there are two new PRs relating to obtaining consent metadata:

prebid/Prebid.js#8043
prebid/Prebid.js#8071

@EskelCz
Copy link
Contributor Author

EskelCz commented Feb 24, 2022

@bretg I just figured out I can read it from the bid requests, therefore it's no issue. Just my intuition was off, kind of mislead by the docs.
Thanks for the investigation, much appreciated.

@EskelCz EskelCz closed this as completed Feb 24, 2022
bretg added a commit that referenced this issue Mar 8, 2022
Clarification related to #3587
bretg added a commit that referenced this issue Mar 8, 2022
Clarification related to #3587
jlaso pushed a commit to AuDigent/prebid.github.io that referenced this issue Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants