Create a simple GDPR consent form.
Till the user doesn't click on the Accept
button, she will see a banner prompting to accept cookies.
Open this example on CodeSandbox:
Users will be presented with a GDPR consent form on every page app/root.tsx till they submit the accept button. Once they submit the consent form, a dummy tracking script at the app/root.tsx will start tracking the user's data (open the browser console too see the dummy tracking message).
If you want to reset the example delete the
gdpr-consent
cookie in theApplication
/cookies
in the browser's developer tools.
The example is using Remix Cookie API.