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

Clarify if __tcfapi is required to be present in scenarios where gdprApplies is false #318

Open
TLadd opened this issue Mar 16, 2022 · 0 comments

Comments

@TLadd
Copy link

TLadd commented Mar 16, 2022

Some of the wording in this spec leads me to believe that it is expected for __tcfapi to always be available synchronously regardless of whether or not GDPR applies or not.

Namely,

__tcfapi

The function __tcfapi must always be a function and cannot be any other type, even if only temporarily on initialization – the API must be able to handle calls at all times.

TcData

If GDPR does not apply to this user in this context then only gdprApplies, tcfPolicyVersion, cmpId and cmpVersion shall exist in the object.

Stub script

A CMP-provided synchronous "stub" script must be added by the publisher to their page before any other scripts that rely on __tcfapi (this usually means between the tags of the HTML document).

It seems like in practice though, the __tcfapi is left undefined on many sites using CMPs when GDPR is not applicable. The above sections of the spec makes me think it really ought to be available regardless, but I could see room for interpretation and I'm left wondering if it's something that the spec takes a position on or if it's left up to the implementation.

Just to briefly touch on why this distinction could matter: for a site that conditionally defines __tcfapi based on whether GDPR applies or not, as another third-party script integrating with CMPs, it is impossible to know without doing a GDPR check yourself whether the site is being loaded where GDPR does not apply, or if the site simply isn't running a CMP. If __tcfapi is mandated to always be defined, you would still be able to setup a listener and end up receiving an event with gdprApplies: false and can differentiate between these two cases and avoid needing to do the GDPR check as well.

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

1 participant