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

onDecline disable Google tag manager #58

Closed
AskatDzhambulov opened this issue Jan 28, 2020 · 2 comments
Closed

onDecline disable Google tag manager #58

AskatDzhambulov opened this issue Jan 28, 2020 · 2 comments

Comments

@AskatDzhambulov
Copy link

Hey!
Im using gatsby-plugin-google-tagmanager plugin. When page open its automaticly set this google tag manager to cookies. But how can i disable google tag manager with onDecline function and don`t set it in cookies ?

@Mastermindzh
Copy link
Owner

You can't use onDecline to prevent the cookie being set unless you can somehow force the google tag manager to wait until the user has clicked either button.

What you can do, is remove the cookie that GoogleTagManager has set with:

Cookies.remove

A stackblitz which shows an example of this

@AskatDzhambulov
Copy link
Author

Thanks!

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