My website gathers information for Google Analytics, so I need to include a Cookie consent banner for the users to opt in/out of.
I saw the plugin gatsby-plug
Attention, I had an issue with tracking via Google Analytics. After a lot of research I found the solution in the reactGaOptions which is used under the hood by gatsby-plugin-google-analytics-gdpr. Use the sampleRate option to enable 100% tracking so that also mobilephones will send the requests to Google. In normal mode it is set to 1% so in low bandwith you will loose a lot of user information.
reactGaOptions: {
debug: false,
gaOptions: {
sampleRate: 100,
siteSpeedSampleRate: 100
}
}