Remix is a full-stack React framework with server rendering and client-side navigation. CookieChimp installs in your root document and re-evaluates on each client transition.Documentation Index
Fetch the complete documentation index at: https://docs.cookiechimp.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Before you start: have your CookieChimp Account ID ready (replace
YOUR_ACCOUNT_ID in the snippets below). If you're testing on localhost, add localhost to Additional Domains in your Account Settings — otherwise the banner won't show locally.How do I load the CookieChimp script?
Add the script tag toapp/root.tsx inside <head> — before Remix’s <Links />, <Meta />, and <Scripts /> components so it runs first:
suppressHydrationWarning prop prevents React from warning about the third-party script mutating <head> after server render.
How do I handle client-side navigation?
Remix uses client-side transitions for in-app links. Re-inject the CookieChimp script on every navigation by listening to the location. The static<script> tag from server-rendered HTML handles the first load, so we skip the initial render.
How do I check consent status in code?
Listen for thecc:onConsented and cc:onUpdate events inside a client-only effect:
Replace
"Google Analytics" and "analytics" with the exact service and category names you configured in CookieChimp.Troubleshooting
- Hydration warnings — make sure the CookieChimp script tag uses
suppressHydrationWarning. - Banner shows on first load but not after navigation — verify
CookieChimpReinitis mounted inside the<body>ofroot.tsx.
- Banner doesn't appear at all — confirm
localhost(or your domain) is in Additional Domains in Account Settings. - Enable Debug mode in the CookieChimp dashboard and check the browser console for logs.