# Cookie Consent Audit

> Use when auditing a website or app consent banner and the cookies, SDKs, and trackers behind it. Covers banner behavior checks, pre-consent network traffic capture, cookie inventory against declared purposes, withdrawal enforcement, and consent record verification. Use when a banner ships, when a regulator complaint lands, or when marketing tags keep firing after reject.

- Skill: `mizazhaider-ceh/cookie-consent-audit` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/cookie-consent-audit`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/cookie-consent-audit/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Marketing & Growth
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/cookie-consent-audit

---


A cookie consent audit tests whether the banner does what it promises.
Most failures are not in the banner text but behind it - a marketing
tag firing before any choice, a "reject all" button that still sets
analytics cookies, or a withdrawal that updates the banner state while
the SDKs keep running. This sub-skill audits the full chain from the
first page load to withdrawal, using network evidence rather than
screenshots of the banner.

## Quick Workflow

1. Inventory the site's cookies, local storage keys, and third party
   requests on a clean first load, before touching the banner.
2. Test the banner itself - equal prominence for accept and reject,
   granular per purpose choices, no pre-ticked non-essential boxes,
   and no consent wall blocking content.
3. Click reject all, then capture traffic again and list every
   non-essential cookie or tracker that still fired.
4. Click accept for one purpose only, and confirm only that purpose's
   tags load while the others stay silent.
5. Withdraw consent and verify tags stop, cookies are deleted or
   expire, and backend processing halts for that purpose.
6. Check the consent record - who, when, which banner text version,
   which purposes, and a proof the record can be retrieved later.
7. File findings per tracker with the evidence (request URLs and
   cookie names), the owner, and the fix deadline.

## 1. Capture pre-consent traffic

The first load, before any banner interaction, is the most important
capture. Anything non-essential here is a finding on its own, because
no consent exists yet.

```bash
# Fetch the homepage the way a first time visitor sees it, with headers shown
curl -sI https://www.example.com/ | grep -i "set-cookie"
# Note every Set-Cookie line. Then repeat with a browser session and record
# every third party request (analytics, ads, social embeds, fonts with tracking)
# that fires before the banner is answered. Strictly necessary cookies only
# (load balancing, security, the consent choice itself) may appear here.
```

## 2. Inventory cookies against declared purposes

```python
#!/usr/bin/env python3
"""Cookie inventory check - every cookie must map to a declared purpose."""
COOKIES = [
    # (name, domain, purpose declared, category)
    ("session_id", "example.com", "login session", "strictly necessary"),
    ("consent_choice", "example.com", "store consent choice", "strictly necessary"),
    ("ga_client", "example.com", "analytics", "analytics"),
    ("ad_tracker", "ads.example.net", "NOT DECLARED", "marketing"),
    ("ab_variant", "example.com", "NOT DECLARED", "analytics"),
]
for name, domain, purpose, category in COOKIES:
    flag = "FINDING" if "NOT DECLARED" in purpose else "ok"
    print(f"{flag:7s} {name:15s} {domain:18s} {category:20s} declared: {purpose}")
# A cookie with no declared purpose is either undocumented (fix the policy)
# or unauthorized (remove the tag). Either way it is a finding, not a note.
```

## 3. Test reject all and withdrawal with traffic evidence

```bash
# Reject-all test, run in a fresh browser profile each time for clean evidence
# Step 1 - load the site, click "Reject all", wait for the page to settle.
# Step 2 - list cookies set and third party requests made after rejection.
# Step 3 - any analytics, marketing, or fingerprinting request after rejection
#          is a FAIL, even if the banner now shows "preferences saved".
# Withdrawal test - accept analytics, browse two pages, withdraw consent,
# then confirm: analytics requests stop, analytics cookies are removed,
# and no new analytics cookie appears on the next page load.
echo "Record for each test - banner text version, choice clicked, timestamp,"
echo "cookies present after the choice, third party hosts contacted after the choice."
```

## 4. Verify the consent record

```python
#!/usr/bin/env python3
"""Consent record completeness check."""
RECORD = {
    "visitor_id": "anon-9f31",
    "timestamp": "2026-10-27T09:14:00Z",
    "banner_version": "v4",
    "choices": {"necessary": True, "analytics": False, "marketing": False},
    "policy_version": "2026-10-01",
}
REQUIRED = ["visitor_id", "timestamp", "banner_version", "choices", "policy_version"]
missing = [field for field in REQUIRED if field not in RECORD]
print("Missing record fields:", missing if missing else "none - record is complete")
print("Choices recorded:", RECORD["choices"])
# A record without the banner version cannot prove what the visitor agreed to,
# because the banner text changes over time. That gap alone is a finding.
```

## Edge cases

- Consent management platform defaults often load tags in "preview"
  or "always on" mode during implementation. Audit the production
  configuration, not the demo, and re-audit after every platform
  upgrade.
- Server side tagging bypasses browser controls. A tag fired from
  your own server after a rejection is still processing without
  consent, so check server logs, not just browser traffic.
- Embedded content (videos, maps, social feeds) can set cookies on
  load even when the embed is only decorative. Use click to load
  placeholders for non-essential embeds, so nothing fires before
  consent.
- Consent given in an app and on the web must agree. A user who
  rejects on the web but is tracked in the app has not given a
  coherent choice, so sync consent state across platforms.
- Dark patterns hide in details - a reject button styled as plain
  text, a second screen for rejection, or a pre-ticked analytics box.
  Test with the same rigor as the traffic checks, because regulators
  do.

## Key references

- GDPR Article 7 - conditions for consent, including withdrawal
- ePrivacy Directive Article 5(3) - cookie consent rule
- EDPB Guidelines 05/2020 on consent
- EDPB cookie banner taskforce report on dark patterns
- Parent skill consent-management - consent records and withdrawal handling

