ga-4-react
ga-4-react copied to clipboard
Calling gtag('consent'...) before configure is not possible
gtag.js allows you to call gtag('consent', 'default', ...) and then later on gtag('consent', 'update', ...) to prevent tracking and cookies before the user has a chance to consent to them. I can't find a way to do this and if I only add and initialise the script after cookie consent is granted, none of the initial pageview data is sent.
Is there a way to do this currently? (My goal is to not save any cookies until allowed but still send the initial pageview, even though it is sent later)