DPDPA is now in force in India. Run a free privacy scan on your site. Scan now

Framework

ConsentX for React & Next.js

Load ConsentX in any React or Next.js app from the document head.

In short
To add a cookie consent banner to React & Next.js, paste the ConsentX snippet into your site head once. In Next.js add the snippet in app/layout.tsx inside <head> (or use next/script with strategy beforeInteractive). In a plain React app add it to public/index.html before </head>. The banner then loads on every page, blocks non-essential trackers before consent, and applies your DPDPA, GDPR and CCPA rules from the dashboard.

Install on React & Next.js

1
Copy your snippet

In ConsentX, open Install and copy your account's embed snippet. It is one small <script> tag scoped to your domain.

2
Paste it in the head

In Next.js: add the snippet to <head> in app/layout.tsx, or use next/script with strategy='beforeInteractive'. In plain React: add it to public/index.html before </head>.

3
Publish

Save and publish your site. The consent banner appears on the next load.

4
Configure in the dashboard

Set your banner design, cookie categories and per-region rules in ConsentX. Changes propagate to your live site with no re-deploy.

One-tag install

Add the snippet once in your site head. The banner loads itself on every page.

Consent Mode v2 + prior blocking

Google signals are denied by default and non-essential trackers stay inert until the visitor chooses.

Geo-aware rules

One banner adapts to GDPR, CCPA, LGPD and DPDPA from your dashboard, with no re-deploy.

Frequently asked questions

Does ConsentX work with React and Next.js?+

Yes. ConsentX runs on React and Next.js with a single script tag added to the site head. The banner then loads on every page, blocks non-essential trackers before consent and applies your region rules.

Will it slow down my React and Next.js site?+

No. The loader is a small module served from a global edge cache and loads asynchronously, so the banner is ready before the page paints without blocking render.

Do I need to edit code on every page?+

No. You add the snippet once in the site-wide head, and it applies across all pages. Everything else (banner copy, categories, regions, DSAR) is managed from your ConsentX dashboard.