Tracking cookies are set before visitors choose
Analytics or advertising cookies are set before a visitor could agree, which UK cookie rules generally do not allow.
Why it matters #
Under the UK's Privacy and Electronic Communications Regulations (PECR), a site must get consent before storing cookies that are not strictly necessary. The ICO's guidance says cookies for online advertising need consent, and it sets out the narrow exceptions.
Cookies set in the first answer from the server, or by tags that run as the page loads, are stored before any banner could ask. Consent given afterwards does not cover them.
How to fix it #
Make analytics and advertising tags wait for consent: load them only after the visitor agrees, through your consent tool or the consent settings of your tag manager. Also check server-side tagging and plugins that set cookies directly.
Then open the page in a private window, accept nothing, and check again with the Cookie Checker and the Tracking Checker.
What it looks like, and fixed #
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
The analytics tag runs as the page loads, so its cookies are set before the banner can ask.
<!-- Held back until the visitor accepts analytics. Your consent tool switches it on. -->
<script type="text/plain" data-consent="analytics"
data-src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
type="text/plain" stops the browser running it. The exact attribute names depend on your consent tool.
Fix it with your AI assistant #
Paste this into ChatGPT, Claude, Gemini or your coding agent. Fill in the words in [square brackets] first. It checks before it changes anything, changes only this, and tells you how to prove it worked.
Help me make [your website address] wait for cookie consent. It uses [your platform and consent tool, e.g. WordPress with Complianz]. A checker says analytics or advertising cookies are set on [the page address] before a visitor could choose, which UK cookie rules generally do not allow. First, read the served page source and Set-Cookie headers (or ask me to paste them), and list each cookie and tag that runs before any choice, and what sets it (server, plugin, theme, pasted code or tag manager). Explain plainly which are strictly necessary (basket, sign-in, security, remembering the choice) and which need consent. Then make every analytics and advertising tag load only after the visitor agrees, through my consent tool or tag manager. Rules: keep necessary cookies working, make rejecting as easy as accepting, back up first, and remind me this is not legal advice. Give exact code or settings and where they go. Finally, tell me to re-check with the URSY.com Cookie Checker at ursy.com/cookie-checker/.
We find the problems, and help you fix them
- Check Run a free tool or the full audit.
- Fix it with your AI Download your AI Fix Pack and drop it into ChatGPT, Claude or Gemini. A free account is enough.
- Re-check Come back, check again, and watch each fix turn green.
Fix it on your platform #
WordPress
Use a consent plugin that blocks scripts until consent, and check that analytics or advertising plugins wait for it. Code pasted into a header plugin often bypasses the banner.
Shopify
Switch on the cookie banner in the customer privacy settings, and check that apps and pixels you added respect the visitor's choice.
Wix
Switch on the cookie banner in the privacy settings, and give each piece of custom code the right cookie category so it waits for consent.
A hand-made site
Load analytics and advertising scripts only from your consent tool's accept callback, or through tag manager triggers that wait for consent.
Check it is fixed #
Open the page in a private window, accept nothing, and run the Cookie Checker again: it should find no analytics or advertising cookies set before any choice. The Tracking Checker should agree.
Official source #
Questions #
Which cookies can I set without asking?
Strictly necessary ones, such as a basket, a sign-in, security, and the cookie that remembers the visitor's choice. The ICO's guidance explains the exceptions.
Do analytics cookies always need consent in the UK?
Under PECR they have generally needed consent. The Data (Use and Access) Act 2025 adds a narrow exception for some analytics with conditions, so check the ICO's current guidance before relying on it. Advertising cookies still need consent.
More problems in Privacy, cookies and tracking
- A tracking tag is added twice Medium priority
- Browsers will ignore some cookies Medium priority
- Old Universal Analytics code is still on the page Low priority