Install ConsentX in one line
Drop in the embed, get your website key, and consent-gate your own scripts. Google Consent Mode v2 and Global Privacy Control are handled for you.
Quick install
The fastest way to add the consent banner is a single tag. Paste it as high as possible inside <head> so it loads before your other scripts, and replace YOUR_KEY with your website key.
<script src="https://app.consentx.io/api/YOUR_KEY/embed.js" async></script>
Prefer to split the stylesheet from the script? The two-tag alternative loads the banner CSS and JS separately. Both forms render the same banner.
<link rel="stylesheet" href="https://app.consentx.io/api/YOUR_KEY/app.css"> <script src="https://app.consentx.io/api/YOUR_KEY/app.js" async></script>
Add your domain to the website in the ConsentX dashboard so the banner is allowed to load on it.
Getting your website key
Your website key is unique to each site you manage. Find it in the dashboard:
- Sign in at app.consentx.io.
- Open Websites and select your site (or add a new one with its domain).
- Copy the key shown in the install snippet and drop it into the tag above.
Do not have an account yet? Create one free and add your first website in a minute.
Consent-gating your own scripts
To hold a script until the visitor consents, set its type totext/plain and tag it with the consent category indata-cx-consent. Point the real source atdata-src instead of src. ConsentX keeps the tag inert and loads it the moment that category is granted.
<!-- This script stays inert until the visitor grants the "analytics" category. -->
<script type="text/plain"
data-cx-consent="analytics"
data-src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX"></script>
<!-- Inline scripts work the same way: the body runs only after consent. -->
<script type="text/plain" data-cx-consent="marketing">
// your marketing pixel init here
</script>You do not have to tag everything. ConsentX also auto-blocks known third-party trackers it recognises, so common analytics and marketing tags are neutralised before consent even if you forget to gate them. Tagging gives you precise per-category control where you want it.
JavaScript API
Call window.ConsentX.open() to reopen the preferences modal. Wire it to a persistent "Cookie preferences" link in your footer so visitors can change or withdraw consent at any time.
<!-- A persistent "Cookie preferences" link for your footer --> <a href="#" onclick="window.ConsentX.open(); return false;">Cookie preferences</a>
The cx:consent event fires on window whenever consent is saved or changed. Its detail carries the granted categories so you can react in your own code.
window.addEventListener('cx:consent', function (e) {
// e.detail.granted is an array of the granted category slugs,
// e.g. ['necessary', 'analytics'] (or ['all'] when "Allow all" is chosen).
if (e.detail.granted.includes('all') || e.detail.granted.includes('analytics')) {
// analytics is allowed — initialise anything not already tag-gated
}
});Handled automatically
Google Consent Mode v2
ConsentX sets and updates the Consent Mode v2 signals for you, so Google tags respect the visitor's choices without extra wiring.
Global Privacy Control
When a browser sends a GPC signal, ConsentX honours it automatically and treats it as an opt-out where the applicable law requires.
DSAR requests & consent receipts
From the preferences modal, visitors can raise data subject access, erasure and grievance requests directly. These land in your dashboard with SLA timers, so you do not need to build a separate intake form.
Every consent decision produces a tamper-evident consent receipt bound into a per-record hash chain. A visitor can retrieve their own receipt as proof of what they agreed to and when, and you can verify the chain independently for audit evidence. See consent receipts and DSAR intake for the full detail.
Get your website key
Create a free account, add your site, and paste the one-line embed.