Installing the script on the website with services in the dashboard
You insert a single Cookies správně script into the website head and remove all measurement and marketing code from the website. Instead, you insert that code into the bar's dashboard, where you assign each piece to a consent category. The website code stays clean and you make changes without a developer.
When to choose this method
- You do not use Google Tag Manager, or you want to bypass it.
- You want to manage services centrally from the dashboard and change them quickly.
- You need a clear record of what runs in which consent category.
What you will need
- Access to the website template, specifically the ability to edit
<head>. - Access to the Cookies správně dashboard.
- The embed code from the license's Implementation tab. The license key is also on the Overview tab.
1. Inserting the bar script
Insert the script as the first script in the <head> of every page, above Google Tag Manager, gtag.js and all other scripts:
<script src="https://cookies-spravne.cz/static/cc_v2?key=YOUR_LICENSE_KEY"></script>Replace YOUR_LICENSE_KEY with the key for the domain; the easiest way is to copy the whole code from the Implementation tab. Insert the script without async and defer: when it loads, the bar sets the Google Consent Mode default, and that must be on the page before any Google tag.
Optionally you can add the &lang=en parameter to force the bar's language. Without it, the language follows the visitor's browser settings.
The older /static/cc address with the id="cookies-spravne" attribute is the original version of the bar. It keeps working on websites that already have it; new installations use /static/cc_v2.
2. Moving services to the dashboard
Remove all measurement and marketing scripts from the website, such as GA4, Google Ads, Meta, LinkedIn, Hotjar, Heureka and similar. This removes the risk of something running without consent or running twice.
Then insert the code into the relevant categories on the Scripts tab in the dashboard. If a service uses a separate library and a separate configuration, insert them as separate blocks in the order the provider recommends. The configuration code sometimes has to run only after the library has loaded.
The bar runs these scripts once the visitor allows their category, and always after it has sent the consent update for Google Consent Mode.
3. Testing
- Open the website in a private window and do not give consent. The bar must appear, no analytics or marketing scripts may run and iframes must be blocked, except those you allowed in the configuration.
- Give consent and check that the scripts from the allowed categories have run.
- Withdraw consent with the Cookie settings link in the footer and check that the relevant scripts no longer run.
- In DevTools, on the Application → Cookies and Network tabs, check that cookies and requests appear only after consent.
- On the license's Overview tab, run the installation check.
Most common mistakes
| Mistake | Consequence |
|---|---|
| An old script forgotten in the website template | Double measurement or running without consent. |
| A wrongly assigned category in the dashboard | The script does not run at all, or runs at the wrong moment. |
The bar script with async, defer or below a Google tag | The Consent Mode default arrives too late and Google tags run without it. |
| A hidden badge without a replacement link | You do not meet the requirement that consent can be withdrawn at any time. The solution is in the Cookie settings link in the footer guide. |
| Iframe blocking turned off globally | A risk that cookies are stored before consent. |
Google tags inserted on the Scripts tab do not load at all until consent is given. According to Google, this is the basic mode of Consent Mode: no data is sent to Google before consent. If you want advanced mode, where Google tags load straight away and send cookieless measurements until consent is given, insert the Google tag into the website code in the usual way below the bar script, or use Google Tag Manager.