Install the script
Where the tag goes, how CookieRay confirms the install, and how to add the cookie declaration to your policy page.
The script tag
Every site has its own tag on its Install page. It looks like this — copy yours from the dashboard rather than from here, because the address and site ID are specific to your account:
<script src="https://YOUR-COOKIERAY-ADDRESS/cmp.js" data-site="YOUR_SITE_ID"></script>
- Put it inside
<head>, as high as you can. It has to run before any tracking script loads, or it cannot stop it. - Do not add
asyncordefer. The tag is deliberately not deferred, for the same reason. - You only paste it once. Banner settings are fetched by the script and update on their own — you never need to touch the tag again.
The script is about 10 KB gzipped.
WordPress
Use Appearance → Theme File Editor → header.php and paste the tag right after <head>, or use a header-code plugin such as WPCode.
Shopify
Open your theme’s code and paste the tag near the top of <head> in theme.liquid.
Confirming the install
The Install page shows the connection status:
| Status | Meaning |
|---|---|
| Waiting — “We haven’t heard from your site yet” | No page with the tag has loaded on your domain yet. |
| Connected — “Your site is talking to us” | The script has loaded from your domain. |
Load any page of your site and the badge turns green within a few seconds. Scans can only run after this.
The cookie declaration
To list your cookies on your privacy or cookie policy page, paste this where the list should appear (again, copy the exact version from your Install page):
<div data-cookieray-declaration></div>
<script src="https://YOUR-COOKIERAY-ADDRESS/d/YOUR_SITE_ID.js" defer></script>
An element with id="cookieray-declaration" works too. The declaration adds no styling of its own; its classes all start with cookieray-declaration, so you can style it to match your page.
Next
Turn the banner on and choose a consent mode — see Blocking scripts.