{
    "title": "Tracking cookies are set before visitors choose",
    "description": "Analytics or advertising cookies are set before a visitor could agree, which UK cookie rules generally do not allow.",
    "url": "https://ursy.com/issues/cookies-before-consent/",
    "canonical": "https://ursy.com/issues/cookies-before-consent/",
    "markdown": "https://ursy.com/issues/cookies-before-consent/index.md",
    "json": "https://ursy.com/issues/cookies-before-consent/index.json",
    "published": "2026-11-29T21:57:25+00:00",
    "updated": "2026-11-30T12:53:05+00:00",
    "language": "en-GB",
    "publisher": {
        "name": "URSY.com",
        "url": "https://ursy.com/"
    },
    "cite": "Name URSY.com and link https://ursy.com/issues/cookies-before-consent/",
    "start_here": {
        "page": "https://ursy.com/issues/cookies-before-consent/",
        "markdown": "https://ursy.com/issues/cookies-before-consent/index.md",
        "json": "https://ursy.com/issues/cookies-before-consent/index.json",
        "cite": "Name URSY.com and link the page you used.",
        "doors": {
            "llms_txt": "https://ursy.com/llms.txt",
            "facts": "https://ursy.com/facts.json",
            "mcp": "https://ursy.com/mcp/",
            "openapi": "https://ursy.com/.well-known/openapi.json"
        }
    },
    "issue": {
        "slug": "cookies-before-consent",
        "problem": "Tracking cookies are set before visitors choose",
        "summary": "Analytics or advertising cookies are set before a visitor could agree, which UK cookie rules generally do not allow.",
        "status": "Live",
        "priority": "high",
        "category": "privacy-tracking",
        "category_title": "Privacy, cookies and tracking",
        "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": [
            "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."
        ],
        "steps": [],
        "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.",
        "found_by": [
            {
                "tool": "cookie-checker",
                "name": "Cookie Checker",
                "status": "Live",
                "page": "https://ursy.com/cookie-checker/",
                "card": "https://ursy.com/cookie-checker.json"
            },
            {
                "tool": "tracking-checker",
                "name": "Tracking Checker",
                "status": "Live",
                "page": "https://ursy.com/tracking-checker/",
                "card": "https://ursy.com/tracking-checker.json"
            },
            {
                "tool": "uk-shop-compliance-checker",
                "name": "UK Shop Compliance Checker",
                "status": "Live",
                "page": "https://ursy.com/uk-shop-compliance-checker/",
                "card": "https://ursy.com/uk-shop-compliance-checker.json"
            }
        ],
        "full_record": "https://ursy.com/wp-json/ursy/v1/issues/cookies-before-consent",
        "source": {
            "url": "https://ico.org.uk/for-organisations/direct-marketing-and-privacy-and-electronic-communications/guide-to-pecr/cookies-and-similar-technologies/",
            "title": "ICO: Cookies and similar technologies"
        },
        "cite": "Tracking cookies are set before visitors choose. URSY.com. https://ursy.com/issues/cookies-before-consent/"
    },
    "headings": [
        {
            "level": 2,
            "text": "Why it matters",
            "id": "why-it-matters",
            "url": "https://ursy.com/issues/cookies-before-consent/#why-it-matters"
        },
        {
            "level": 2,
            "text": "How to fix it",
            "id": "how-to-fix-it",
            "url": "https://ursy.com/issues/cookies-before-consent/#how-to-fix-it"
        },
        {
            "level": 3,
            "text": "What the problem looks like",
            "id": "what-the-problem-looks-like",
            "url": "https://ursy.com/issues/cookies-before-consent/#what-the-problem-looks-like"
        },
        {
            "level": 3,
            "text": "What it looks like fixed",
            "id": "what-it-looks-like-fixed",
            "url": "https://ursy.com/issues/cookies-before-consent/#what-it-looks-like-fixed"
        },
        {
            "level": 2,
            "text": "Fix it with your AI assistant",
            "id": "fix-it-with-your-ai-assistant",
            "url": "https://ursy.com/issues/cookies-before-consent/#fix-it-with-your-ai-assistant"
        },
        {
            "level": 2,
            "text": "Fix it on your platform",
            "id": "fix-it-on-your-platform",
            "url": "https://ursy.com/issues/cookies-before-consent/#fix-it-on-your-platform"
        },
        {
            "level": 3,
            "text": "WordPress",
            "id": "wordpress",
            "url": "https://ursy.com/issues/cookies-before-consent/#wordpress"
        },
        {
            "level": 3,
            "text": "Shopify",
            "id": "shopify",
            "url": "https://ursy.com/issues/cookies-before-consent/#shopify"
        },
        {
            "level": 3,
            "text": "Wix",
            "id": "wix",
            "url": "https://ursy.com/issues/cookies-before-consent/#wix"
        },
        {
            "level": 3,
            "text": "A hand-made site",
            "id": "a-hand-made-site",
            "url": "https://ursy.com/issues/cookies-before-consent/#a-hand-made-site"
        },
        {
            "level": 2,
            "text": "Check it is fixed",
            "id": "check-it-is-fixed",
            "url": "https://ursy.com/issues/cookies-before-consent/#check-it-is-fixed"
        },
        {
            "level": 2,
            "text": "Official source",
            "id": "official-source",
            "url": "https://ursy.com/issues/cookies-before-consent/#official-source"
        },
        {
            "level": 2,
            "text": "Questions",
            "id": "questions",
            "url": "https://ursy.com/issues/cookies-before-consent/#questions"
        },
        {
            "level": 3,
            "text": "Which cookies can I set without asking?",
            "id": "which-cookies-can-i-set-without-asking",
            "url": "https://ursy.com/issues/cookies-before-consent/#which-cookies-can-i-set-without-asking"
        },
        {
            "level": 3,
            "text": "Do analytics cookies always need consent in the UK?",
            "id": "do-analytics-cookies-always-need-consent-in-the-uk",
            "url": "https://ursy.com/issues/cookies-before-consent/#do-analytics-cookies-always-need-consent-in-the-uk"
        }
    ],
    "links": [
        {
            "text": "cookies",
            "url": "https://ursy.com/wiki/cookie/",
            "internal": true
        },
        {
            "text": "PECR",
            "url": "https://ursy.com/wiki/pecr/",
            "internal": true
        },
        {
            "text": "ChatGPT",
            "url": "https://ursy.com/wiki/chatgpt/",
            "internal": true
        },
        {
            "text": "cookie banner",
            "url": "https://ursy.com/wiki/cookie-banner/",
            "internal": true
        },
        {
            "text": "ICO: Cookies and similar technologies",
            "url": "https://ico.org.uk/for-organisations/direct-marketing-and-privacy-and-electronic-communications/guide-to-pecr/cookies-and-similar-technologies/",
            "internal": false
        }
    ],
    "words": 682,
    "text": "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 the problem looks like <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. What it looks like fixed <!-- 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, and fill in the words in square brackets: 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/. 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 ICO: Cookies and similar technologies 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.",
    "source": "https://ursy.com/issues/cookies-before-consent/"
}