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

How to use __tcfapi to define consent mode v2 in gtm? #367

Open
tiago-snigel opened this issue Mar 4, 2024 · 2 comments
Open

How to use __tcfapi to define consent mode v2 in gtm? #367

tiago-snigel opened this issue Mar 4, 2024 · 2 comments

Comments

@tiago-snigel
Copy link

tiago-snigel commented Mar 4, 2024

I'm trying to implement user consent management in my website using Google Tag Manager (GTM) and the Transparency and Consent Framework (TCF) API v2.

I'm unsure about the proper way to utilize the __tcfapi function within GTM to update Consent Mode v2 based on the TCF data received from my CMP. I've looked at some documentation and examples, but I'm still struggling to understand how to correctly map the consent information and update GTM's consent mode accordingly.

Any guidance or code examples on how to achieve this using GTM and the TCF API v2 would be greatly appreciated.

My plan of action would be to create a custom html tag and have the addEventListener to get the tcdata and with that tcdata set the consent.

gtag('consent', 'update', {
  'ad_storage': 'granted',
  'ad_user_data': 'granted'
...
});

Is this something that should work? And how about the trigger should I use a custom event?

Thank you very much in advance.

@HeinzBaumann
Copy link
Collaborator

Hi @tiago-snigel You may want to review this help documentation: https://support.inmobi.com/choice/how-to-guide/integrate-the-tag-or-sdk/site-implementation-tag/google-tag-manager-gtm-implementation#assumptions.

@tiago-snigel
Copy link
Author

Thank yo uvery much @HeinzBaumann I'll check that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants