I implemented Google Analytics tracking using @nuxtjs/google-analytics
I would now like to control whether or not the user is being tracked based on a consent given by the user. I found nuxt-cookie-control, which appears to allow collecting consent.
Based on the documentation for @nuxtjs/google-analytics // vue-analytics, it seems to just be a matter of calling this.$ga.disable() if a user does not give consent.
I noticed in some early fiddling efforts, however, that whenever I made a call to this.$ga.disable(), it did not seem to take effect beyond the next refresh.
The documentation also points out that "the opt-out needs to happen before trackers or queues are initialized."
I am a bit at a loss how/where in the application I would need to make the call to this.$ga.disable(). Can anyone give me pointers?