Documentation

Install Cookivo, block trackers, and connect it to your own code.

Quick start

  1. Create a free account and add your website.
  2. Run the scanner and add the trackers it finds.
  3. Design your banner and press Publish.
  4. Copy your install code from the Install page (it already contains your IDs) and paste both lines as the first items in your site's <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.

Platform guides

WordPress

  1. Install the free plugin WPCode (Plugins → Add New).
  2. Go to Code Snippets → Header & Footer.
  3. Paste your install code at the top of the Header box and save.
  4. Clear your caching plugin's cache.

Shopify

  1. Online Store → Themes → ⋯ → Edit code.
  2. Open layout/theme.liquid.
  3. Paste your install code right after <head> and save.
  4. Optional: turn off Shopify's own banner in Settings → Customer privacy.

Wix

  1. Dashboard → Settings → Custom Code (Premium plan needed).
  2. Add Custom Code, paste the install code.
  3. Apply to All pages, place in Head, load once.
  4. Turn off Wix's built-in cookie banner.

Webflow

  1. Site settings → Custom code.
  2. Paste the install code at the top of Head code.
  3. Save and publish.

Framer

  1. Site Settings → General → Custom Code.
  2. Paste the install code in Start of <head> tag.
  3. Publish.

Squarespace

  1. Settings → Advanced → Code Injection (Business plan or higher).
  2. Paste the install code at the top of Header.
  3. Turn off Squarespace's own cookie banner.

Next.js / React

  1. Add the script to your root layout's <head> as a plain <script> tag (not next/script with afterInteractive), so it runs before other tags.

Blocking scripts

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.

Videos & maps

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>

Google Analytics, Ads and Tag Manager

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.

Countries & regions

Cookivo looks up each visitor's country (cached for a day) and applies the rule you set in Banner design → Behaviour:

Visitors fromDefault rule
EU, EEA, UK, Switzerland, BrazilOpt-in: nothing optional runs until they agree
United StatesOpt-out: trackers run, with a “Do Not Sell or Share” button and GPC respected
Everyone elseOpt-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.

Integrations

  • WordPress: the Cookivo plugin adds the code and reports choices to the WP Consent API.
  • Shopify: choices are sent to Shopify's Customer Privacy API automatically.
  • Google: Consent Mode v2 for Analytics and Ads.
  • Microsoft Advertising: UET consent mode.
  • Meta Pixel: consent grant/revoke when the pixel is on the page.

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>

Cookie declaration

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>

JavaScript API

MethodWhat 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.modeopt-in or opt-out for the current visitor.
Cookivo.on("change", function (consent) {
  if (consent.categories.analytics) {
    // start your own analytics
  }
});

Script options

Settings from the dashboard are used automatically. If you use Cookivo without the dashboard, you can configure it with attributes on the script tag:

AttributeMeaning
data-site-idYour site ID from the Install page. Required.
data-langauto (default) or en, bn, de, fr, es.
data-modeauto (by region), opt-in or opt-out.
data-consent-modefalse to turn off Google Consent Mode v2.
data-auto-blockfalse to block only scripts you mark by hand.

Troubleshooting

The banner doesn't appear

  • Check you pressed Publish in the dashboard.
  • Make sure the code is inside <head> and clear your site or CDN cache.
  • You may have already chosen: run Cookivo.reset() in the browser console, or open a private window.

A tracker still runs before consent

  • Cookivo must be the first script in <head>.
  • Add the tracker in the dashboard (Trackers → Add custom tracker) with part of its script URL, or block it by hand.

No consents in analytics

  • Use the Check now button on the Install page after clicking a button on your banner.