Open markabruce opened 3 years ago
is there already a solution for this? would be nice if the cookies are set as soon as the optIn() is called...
I noticed the same thing and found the solution in the documentation.
Instead of setting your plugin with enabled:false
set it with bootstrap:false
and after you get your consent you can call the bootstrap and the cookies will be immediately available
https://matteo-gabriele.gitbook.io/vue-gtag/custom-installation
Description
I am wanting to use my own cookie consent banner in conjunction with this library.
this.$gtag.optIn()
calling works correctly, however, a full page reload or a route change is required before the events are pushed from the dataLayer and cookies are added to the cookie store.Expected behavior
Actual behavior
See above.
Environment
Run this command in the project folder and fill in their results:
npm ls vue-gtag
: vue-gtag@1.16.1Then, specify:
Reproducible Demo
main.js
CookieConsentBanner.vue