68publishers / cookie-consent

:cookie: Cookie-consent widget with GTM, GCM & CMP integration
MIT License
118 stars 28 forks source link

wait_for_update - Optional: Integrate with asynchronous consent management platforms #70

Open gotanasro3 opened 9 months ago

gotanasro3 commented 9 months ago

https://developers.google.com/tag-platform/security/guides/consent?consentmode=advance

Optional: Integrate with asynchronous consent management platforms If your banner loads asynchronously, it might not always run before your Google tags. To handle such situations, specify wait_for_update along with a millisecond value to control how long to wait before data is sent.

For example, to deny ad_storage on a particular page by default, but to allow your CMP to update consent status, use wait_for_update. In the following code, ad_storage defaults to denied, and the consent tool is given 500 milliseconds to call gtag('consent', 'update', ...) before tags fire:

could you please implement this option as well?

tg666 commented 9 months ago

I don't think it needs to be implemented. We set default consent already in the GTM template, according to the user's previous preferences. The template should be set to trigger Consent initialization - all pages, so it will trigger before other tags and set the default consent.