Install
Add the script to any website
One line of code at the top of your head section works on any website. How to place it, check it and what to do when it does not show.
If your platform has no dedicated guide, or you edit the HTML yourself, this is all you need: one script line.
#Copy your line
Open your website in the dashboard, then Installation. Choose Other / HTML. You will see a line like this, with your own site ID:
<script id="cookietrue" src="https://cdn.cookietrue.com/s/ct_yoursiteid.js"></script>#Paste it first in the head
Paste it as the very first element after <head>, above every other script, stylesheet and tag.
<head>
<script id="cookietrue" src="https://cdn.cookietrue.com/s/ct_yoursiteid.js"></script>
<meta charset="utf-8">
<title>Your website</title>
<!-- Google Analytics, Meta Pixel and the rest come after -->
</head>The order matters. CookieTrue can only hold back scripts that start loading after it. A tracker placed above it would already be running before the visitor has chosen anything.
#Check that it works
- Open the page in a private window. The banner should appear.
- Press Reject all. In your browser's developer tools, open Application → Cookies: no analytics or marketing cookies should be there.
- In the dashboard, press Check installation. We open your homepage and look for the line. The first visit to your website also marks the site as live without any click.
#Subdomains and other domains
Subdomains of the address you added, such as shop.example.com for example.com, are covered by the same website. Consent choices are only accepted from your website's domain and its subdomains, so a copied snippet cannot write records into your consent log from someone else's site.
A completely different domain needs its own website in CookieTrue. Add it from All websites → Add your website. Your plan covers several websites.
#When the banner does not appear
See Troubleshooting. The most common causes are a cached page, the line placed lower in the head, or a content security policy that blocks cdn.cookietrue.com.
#Pages that are built from a template
Put the line in the one template every page shares (often called layout, header or base). Do not paste it into individual pages.