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 can I set window['ga-disable-UA-XXXX-XX'] to true initially #20

Open
moritzlaube opened this issue Nov 9, 2019 · 5 comments
Open

Comments

@moritzlaube
Copy link

I'd like to implement an Opt-In component in my nuxt app to actively opt into Google Analytics Tracking (due to European DSGVO regulation). Is there a way to set window['ga-disable-UA-XXXX-XX'] = true initially to prevent gtag() to start tracking?

Only when the user hits an agree-button the i'd like to set window['ga-disable-UA-XXXX-XX'] = false programmatically in my Nuxt-component. Is that possible, too?

Thanks for helping out.

@dohomi
Copy link
Contributor

dohomi commented Nov 10, 2019

try with disableAutoPageTrack and then modify tracking in your main app similar what explained here:
https://github.com/nuxt-community/google-gtag#to-make-sure-that-every-page-is-tracked-correctly

@toniengelhardt
Copy link

The problem is that even with disableAutoPageTrack set to true the gtag cookie is still set. Is there a way to avoid that?

@itpropro
Copy link

itpropro commented Mar 23, 2020

This is the most important functionality, otherwise no one can use this module on their website without being sued (in worst case). Even, if you ask people for their consent, you are not allowed to enable any analytics or tracking before the user has actually clicked yes. Otherwise it would be a violation of EU ePrivacy directive, GDPR or both. This applies to all websites, no matter where they are hosted, as long as european citizens are part of the target group of that website.
It would be great, if someone could answer how this kind of behavior can be configured using this nuxt module. If it's not possible I have to use gtag natively and use the provided window['ga-disable-GA_MEASUREMENT_ID'] = true; method.

@bjwieland
Copy link

This is the only (not quite good) solution working for me at the moment. This is the code within my cookie component...

accept() { if (process.browser) { localStorage.setItem("GDPR:accepted", true) window['ga-disable-UA-0000000-1'] = false window.location.reload() } },

@Snake231088
Copy link

Any update?

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

6 participants