Install Cookivo, block trackers, and connect it to your own code.
<head>:<script src="https://YOUR-PROJECT.supabase.co/storage/v1/object/public/configs/YOUR_SITE_ID.js"></script>
<script src="https://cookivo.com/cookivo.js" data-site-id="YOUR_SITE_ID"
data-api="https://YOUR-PROJECT.supabase.co" data-key="PUBLIC_KEY"></script>
The first line loads your published settings, the second runs the banner. You install once. Every time you press Publish, the banner on your site updates within seconds for new visitors.
layout/theme.liquid.<head> and save.<head> as a plain <script> tag (not next/script with afterInteractive), so it runs before other tags.Cookivo automatically blocks well-known trackers and anything in your tracker list until the visitor allows its category. For any other script, change its type and add a category:
<script type="text/plain" data-cookivo="analytics">
// runs only after the visitor allows Analytics
</script>
<script type="text/plain" data-cookivo="marketing"
data-src="https://example.com/pixel.js"></script>
Categories: preferences, analytics, marketing. Scripts without a category are treated as necessary.
Browsers may download (but never run) a tracker that is written directly into your HTML before Cookivo blocks it. If you need the strictest setup, use the type="text/plain" method above for those tags.
YouTube, Vimeo, Google Maps and other known embeds are replaced with an “Allow & load” card until accepted. For other embeds:
<iframe data-cookivo="marketing" data-src="https://player.example.com/embed/123"></iframe>
Keep your Google tags as they are. Cookivo sets Google Consent Mode v2 defaults before they load and updates them when visitors choose. Analytics and Ads then run cookieless until consent.
Don't load Cookivo through Google Tag Manager: it has to run before GTM to block other tags in time.
Cookivo looks up each visitor's country (cached for a day) and applies the rule you set in Banner design → Behaviour:
| Visitors from | Default rule |
|---|---|
| EU, EEA, UK, Switzerland, Brazil | Opt-in: nothing optional runs until they agree |
| United States | Opt-out: trackers run, with a “Do Not Sell or Share” button and GPC respected |
| Everyone else | Opt-in (you can change it) |
To see what a visitor from another country sees, add ?cookivo_country=DE (or US, GB, IN…) to any page address.
Visitors must be able to change their mind. Cookivo shows a small cookie button by default. You can also add a link anywhere, such as your footer:
<a href="#cookie-settings">Cookie settings</a>
Put this on your privacy page and Cookivo fills it with a table of your trackers, grouped by category. It updates every time you publish.
<div data-cookivo-declaration></div>
| Method | What it does |
|---|---|
Cookivo.open() | Open the preferences window. |
Cookivo.get() | Current consent object, or null if the visitor hasn't chosen yet. |
Cookivo.has('analytics') | true if a category is allowed. |
Cookivo.acceptAll() / Cookivo.rejectAll() | Set a choice from your own buttons. |
Cookivo.set({ analytics: true }) | Change individual categories. |
Cookivo.on('change', fn) | Run code whenever consent changes. The page also receives a cookivo:change event and a cookivo_consent_update dataLayer event. |
Cookivo.reset() | Forget the choice and show the banner again. |
Cookivo.mode | opt-in or opt-out for the current visitor. |
Cookivo.on("change", function (consent) {
if (consent.categories.analytics) {
// start your own analytics
}
});
Settings from the dashboard are used automatically. If you use Cookivo without the dashboard, you can configure it with attributes on the script tag:
| Attribute | Meaning |
|---|---|
data-site-id | Your site ID from the Install page. Required. |
data-lang | auto (default) or en, bn, de, fr, es. |
data-mode | auto (by region), opt-in or opt-out. |
data-consent-mode | false to turn off Google Consent Mode v2. |
data-auto-block | false to block only scripts you mark by hand. |
<head> and clear your site or CDN cache.Cookivo.reset() in the browser console, or open a private window.<head>.