ga-4-react icon indicating copy to clipboard operation
ga-4-react copied to clipboard

Calling gtag('consent'...) before configure is not possible

Open grantmcdade opened this issue 3 years ago • 0 comments

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)

grantmcdade avatar Aug 20 '21 11:08 grantmcdade