Consentio

A cookie banner you add to your own site. It asks visitors what they allow, remembers the answer, and tells your tracking tags what to do about it.

You host it yourself. It is one script file and the settings files it reads β€” no account, no server, nothing running anywhere but the visitor’s browser. It suits a static site, or any site whose HTML you can edit.

There is no npm package and nothing to import. You copy two files into your site, or serve them from a CDN at a version you pin. Apache-2.0, no dependencies.

  • Put it in your HTML

    One <script> tag at the top of your pages. Pick this if you can edit your own HTML.

    Set it up this way
  • Use Google Tag Manager

    One template, on one trigger. Pick this if everything on your site already runs through a container.

    Set it up this way
  • Something is wrong

    The banner will not show, it comes back every time, or your tags fire before anyone answers.

    Fixes for the common ones

🧭 Choose a route first

There are two ways to install it, and they are not the same. The choice decides what your banner can actually stop.

Β  Put it in your HTML Use Google Tag Manager
Pick this if you can edit the <head> of your pages everything on your site already runs through one container
What you add one <script> tag, plus two files you host one template, on one trigger
Where your settings live two small files you edit by hand fields you fill in inside Tag Manager
What it can stop anything on the page only what Tag Manager loads
What it costs the page waits for one small file β€” 4.9 KB, about 2 KB compressed nothing extra on the page, but read the warning below

If you are not sure, put it in your HTML. It is the one that covers everything.

How it works has the same comparison in technical terms, if you would rather read it that way.

⚠️ What Tag Manager cannot cover

The Tag Manager route can only stop things Tag Manager loads. Anything pasted straight into a page β€” an embedded video, a chat widget, a tracking pixel someone added to a footer β€” runs whatever the visitor answered, because the banner never sees it.

So this route works if, and only if, everything on your site already goes through the container. If anything is pasted into a page, put it in your HTML instead. That way the banner covers the whole page.

If you are not certain which is true of your site, that is itself the answer: choose the HTML route.

🚫 The two routes do not mix

Pick one. Install both and your visitors get two banners that do not know about each other, from two copies of Consentio running side by side.

πŸ“‚ The rest of the documentation

Start at the top. The last six are reference β€” read them when you need them, not before.

Page What is in it
Put it in your HTML four steps, then the detail
Use Google Tag Manager four steps, then the detail
Try it on this page the live banner, and a button that clears your answer so it shows again
Troubleshooting symptom, cause, fix
Settings every option, with defaults and a full example
How it works load order, what runs when, and why the script cannot wait
The cookie what it stores, how long it lasts, and what to put in your cookie policy
What it tells Google exactly what Consentio sends, and how to check it arrived
Asking everyone again how to throw away every stored answer, and when that is the right thing
Events how to run your own code when someone answers
Try it through a tag manager the one page here with no script tag, for checking that both ways agree about the same visitor

🏁 Versions

This site describes 0.2.0, and it is the newest published version.

If you are upgrading from 0.0.4: remove async or defer from the script tag. In 0.0.4 marking it async stopped the banner working with no warning at all; the script has to block, and now it says so. Nothing else changes for you.

If you use the Tag Manager template, download the new .tpl from the release and import it over the one in your container. Nothing tells you a new one exists; the template you imported keeps loading the banner version it was built against.

Pin an exact version wherever you load the files from. A URL that follows the newest release will change what your site runs without you touching anything.

πŸ“„ Licence

Apache-2.0. No runtime dependencies.