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
- Inventory the site's cookies, local storage keys, and third party
requests on a clean first load, before touching the banner.
- 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.
- Click reject all, then capture traffic again and list every
non-essential cookie or tracker that still fired.
- Click accept for one purpose only, and confirm only that purpose's
tags load while the others stay silent.
- Withdraw consent and verify tags stop, cookies are deleted or
expire, and backend processing halts for that purpose.
- Check the consent record - who, when, which banner text version,
which purposes, and a proof the record can be retrieved later.
- 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.
# 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
#!/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
# 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
#!/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
1---2name: cookie-consent-audit3description: "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."4version: "1.0.0"5domain: privacy6lifecycle: stable7last_verified: "2026-10-27"8parent: consent-management9requires: [consent-management]10extends: []11relates: [gdpr-engineering, privacy-threat-model]12tools:13 - name: Python14 version: "3.12"15 - name: curl16 version: "8.5"17metadata:18 source: https://skillmd.com/skills/mizazhaider-ceh/cookie-consent-audit19---2021A cookie consent audit tests whether the banner does what it promises.22Most failures are not in the banner text but behind it - a marketing23tag firing before any choice, a "reject all" button that still sets24analytics cookies, or a withdrawal that updates the banner state while25the SDKs keep running. This sub-skill audits the full chain from the26first page load to withdrawal, using network evidence rather than27screenshots of the banner.2829## Quick Workflow30311. Inventory the site's cookies, local storage keys, and third party32 requests on a clean first load, before touching the banner.332. Test the banner itself - equal prominence for accept and reject,34 granular per purpose choices, no pre-ticked non-essential boxes,35 and no consent wall blocking content.363. Click reject all, then capture traffic again and list every37 non-essential cookie or tracker that still fired.384. Click accept for one purpose only, and confirm only that purpose's39 tags load while the others stay silent.405. Withdraw consent and verify tags stop, cookies are deleted or41 expire, and backend processing halts for that purpose.426. Check the consent record - who, when, which banner text version,43 which purposes, and a proof the record can be retrieved later.447. File findings per tracker with the evidence (request URLs and45 cookie names), the owner, and the fix deadline.4647## 1. Capture pre-consent traffic4849The first load, before any banner interaction, is the most important50capture. Anything non-essential here is a finding on its own, because51no consent exists yet.5253```bash54# Fetch the homepage the way a first time visitor sees it, with headers shown55curl -sI https://www.example.com/ | grep -i "set-cookie"56# Note every Set-Cookie line. Then repeat with a browser session and record57# every third party request (analytics, ads, social embeds, fonts with tracking)58# that fires before the banner is answered. Strictly necessary cookies only59# (load balancing, security, the consent choice itself) may appear here.60```6162## 2. Inventory cookies against declared purposes6364```python65#!/usr/bin/env python366"""Cookie inventory check - every cookie must map to a declared purpose."""67COOKIES = [68 # (name, domain, purpose declared, category)69 ("session_id", "example.com", "login session", "strictly necessary"),70 ("consent_choice", "example.com", "store consent choice", "strictly necessary"),71 ("ga_client", "example.com", "analytics", "analytics"),72 ("ad_tracker", "ads.example.net", "NOT DECLARED", "marketing"),73 ("ab_variant", "example.com", "NOT DECLARED", "analytics"),74]75for name, domain, purpose, category in COOKIES:76 flag = "FINDING" if "NOT DECLARED" in purpose else "ok"77 print(f"{flag:7s} {name:15s} {domain:18s} {category:20s} declared: {purpose}")78# A cookie with no declared purpose is either undocumented (fix the policy)79# or unauthorized (remove the tag). Either way it is a finding, not a note.80```8182## 3. Test reject all and withdrawal with traffic evidence8384```bash85# Reject-all test, run in a fresh browser profile each time for clean evidence86# Step 1 - load the site, click "Reject all", wait for the page to settle.87# Step 2 - list cookies set and third party requests made after rejection.88# Step 3 - any analytics, marketing, or fingerprinting request after rejection89# is a FAIL, even if the banner now shows "preferences saved".90# Withdrawal test - accept analytics, browse two pages, withdraw consent,91# then confirm: analytics requests stop, analytics cookies are removed,92# and no new analytics cookie appears on the next page load.93echo "Record for each test - banner text version, choice clicked, timestamp,"94echo "cookies present after the choice, third party hosts contacted after the choice."95```9697## 4. Verify the consent record9899```python100#!/usr/bin/env python3101"""Consent record completeness check."""102RECORD = {103 "visitor_id": "anon-9f31",104 "timestamp": "2026-10-27T09:14:00Z",105 "banner_version": "v4",106 "choices": {"necessary": True, "analytics": False, "marketing": False},107 "policy_version": "2026-10-01",108}109REQUIRED = ["visitor_id", "timestamp", "banner_version", "choices", "policy_version"]110missing = [field for field in REQUIRED if field not in RECORD]111print("Missing record fields:", missing if missing else "none - record is complete")112print("Choices recorded:", RECORD["choices"])113# A record without the banner version cannot prove what the visitor agreed to,114# because the banner text changes over time. That gap alone is a finding.115```116117## Edge cases118119- Consent management platform defaults often load tags in "preview"120 or "always on" mode during implementation. Audit the production121 configuration, not the demo, and re-audit after every platform122 upgrade.123- Server side tagging bypasses browser controls. A tag fired from124 your own server after a rejection is still processing without125 consent, so check server logs, not just browser traffic.126- Embedded content (videos, maps, social feeds) can set cookies on127 load even when the embed is only decorative. Use click to load128 placeholders for non-essential embeds, so nothing fires before129 consent.130- Consent given in an app and on the web must agree. A user who131 rejects on the web but is tracked in the app has not given a132 coherent choice, so sync consent state across platforms.133- Dark patterns hide in details - a reject button styled as plain134 text, a second screen for rejection, or a pre-ticked analytics box.135 Test with the same rigor as the traffic checks, because regulators136 do.137138## Key references139140- GDPR Article 7 - conditions for consent, including withdrawal141- ePrivacy Directive Article 5(3) - cookie consent rule142- EDPB Guidelines 05/2020 on consent143- EDPB cookie banner taskforce report on dark patterns144- Parent skill consent-management - consent records and withdrawal handling