Skip to main content
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.
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 to app/root.tsx inside <head>before Remix’s <Links />, <Meta />, and <Scripts /> components so it runs first:
Replace YOUR_ACCOUNT_ID with your actual CookieChimp Account ID from your dashboard.
The 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.
Add it to your root layout:

Listen for the cc: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.
For all available events, see Callbacks & Events.

Troubleshooting

  • Hydration warnings — make sure the CookieChimp script tag uses suppressHydrationWarning.
  • Banner shows on first load but not after navigation — verify CookieChimpReinit is mounted inside the <body> of root.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.