# Cookie Consent Scanner – GDPR & TTDSG Cookie Audit (`adamplaenitz/cookie-consent-scanner`) Actor

Find cookies and tracker requests a website sets BEFORE consent. Classifies cookies and third-party domains (necessary, analytics, marketing …), detects the consent banner / CMP (Cookiebot, Usercentrics, OneTrust, Borlabs, TCF) and lists issues per page.

- **URL**: https://apify.com/adamplaenitz/cookie-consent-scanner.md
- **Developed by:** [Adam Plänitz](https://apify.com/adamplaenitz) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $8.00 / 1,000 page scanneds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Cookie Consent Scanner – GDPR & TTDSG Cookie Audit

**Find out which cookies and trackers a website sets *before* the visitor has agreed to anything.** The Actor opens each page in a fresh headless Chromium profile, does **not** touch the cookie banner, waits for the page to settle and then records every cookie in the browser and every request to a third-party domain. Cookies and domains are classified as *necessary*, *functional*, *analytics*, *marketing* or *unknown*, the consent banner / consent management platform (CMP) is detected, and each page gets a list of concrete issues such as "marketing cookie set before consent". Export as JSON, CSV or Excel, or connect to Google Sheets, Slack, Make, Zapier, n8n or webhooks.

> **Not legal advice.** The Actor shows a technical snapshot of the state before any consent interaction. Whether a cookie or request is lawful depends on its purpose, the consent text, legal exceptions and the jurisdiction, which a machine cannot judge. Use the results as a starting point for a review by your data protection officer or lawyer.

### What does it do?

1. Opens each URL in its own, empty browser context (no cookies from earlier pages), by default with German browser language and time zone.
2. Waits for the load event, network idle (max. 10 s) and an extra 4 s (adjustable), because many tags fire late. **The banner is never clicked.**
3. Reads all cookies of the browser context – first-party and third-party, including cookies set by iframes and pixels – with name, domain, path, expiry/lifetime, `Secure`, `HttpOnly`, `SameSite` and partitioning. **Cookie values are never stored.**
4. Groups all requests to other sites by registrable domain (e.g. `doubleclick.net`) with category, service name, request count and resource types. Detects Google Consent Mode signals (`gcs=G100` = denied).
5. Detects consent tools: Usercentrics, Cookiebot, OneTrust, Borlabs Cookie, Consentmanager, CCM19, Didomi, Klaro, Complianz, Real Cookie Banner, CookieYes, Iubenda, Sourcepoint, Quantcast Choice, TrustArc, Osano, Termly, Cookie Script and Google Funding Choices – plus the IAB TCF API (`__tcfapi` ping: CMP ID, `gdprApplies`, display status) and a generic visible-banner heuristic.
6. Applies the issue rules below and gives each page a risk level `high`, `medium`, `low` or `none`.
7. Optional crawl: follows links to other pages on the same host until *Maximum pages* is reached – every page again in a fresh profile.

#### Issue rules

| Code | Severity | Meaning |
|---|---|---|
| `MARKETING_COOKIE_BEFORE_CONSENT` | high | Advertising / social cookies (e.g. `_fbp`, `IDE`, `_gcl_au`) exist before consent. |
| `ANALYTICS_COOKIE_BEFORE_CONSENT` | high | Analytics cookies (e.g. `_ga`, `_hjSession_*`, `_pk_id.*`) exist before consent. |
| `MARKETING_REQUEST_BEFORE_CONSENT` | high (medium with Consent Mode "denied") | Requests to advertising/social domains – the IP address is transmitted. |
| `ANALYTICS_REQUEST_BEFORE_CONSENT` | medium (low with Consent Mode "denied") | Requests to analytics / tag manager domains. |
| `GOOGLE_FONTS_REMOTE` | medium | Google Fonts loaded from Google servers (LG München I, 3 O 17493/20). |
| `UNKNOWN_THIRD_PARTY_COOKIE` | medium | Third-party cookie whose purpose is not in the rule list. |
| `UNKNOWN_FIRST_PARTY_COOKIE` | low | First-party cookie that could not be classified – check whether it is strictly necessary. |
| `NO_CONSENT_BANNER` | high / info | No banner or CMP found – high if tracking was found, info otherwise. |
| `CMP_PRESENT_BUT_TRACKING` | info | A CMP is present, yet tracking already runs before the decision. |
| `LONG_COOKIE_LIFETIME` | info | Non-essential cookie lives longer than 13 months. |
| `THIRD_PARTY_COOKIE_NOT_SECURE` | info | Third-party cookie without the `Secure` flag. |
| `NON_EU_VISITOR` | info | The website saw a visitor from outside the EU/EEA (see "Visitor location"). |

### Who is it for?

- **Website owners, shops and agencies** who want to check that their consent tool really blocks tags until the visitor agrees (GDPR, ePrivacy Directive, German § 25 TDDDG – formerly TTDSG).
- **Data protection officers and consultants** who need a quick, repeatable inventory of cookies and third parties for many sites or pages.
- **Monitoring:** schedule weekly runs and see when a new tracker appears before consent.

### Visitor location (important)

Many consent tools decide **by the visitor's IP address** whether to show a banner. Visitors from outside the EU often get no banner and all tags at once. Apify servers are mostly located in the USA, so **without a proxy a site may behave as it does for US visitors**. Every result row contains `visitorCountry` (as seen by the web, via Cloudflare's public trace endpoint) and `euVisitor`; non-EU scans get the `NON_EU_VISITOR` note. **For a GDPR check, choose a proxy with an EU country** in the input, e.g. Apify Proxy group *RESIDENTIAL* with country *Germany*. In our tests, the same large news site showed 7 cookies before consent from a German residential IP, but 198 cookies (89 of them marketing) from a US data centre.

### Input

| Field | Default | Description |
|---|---|---|
| URLs to scan | – | One per line. Bare domains open as `https://domain/`. |
| Also scan linked pages on the same site | off | Same-host crawl, each page in a fresh profile. |
| Maximum pages | 10 | Cap for scanned pages per run (start URLs + crawled pages). |
| Wait after page load | 4 s | Extra time after load + network idle before cookies are read. |
| Browser language | de-DE | `Accept-Language` / `navigator.language`. |
| Browser time zone | Europe/Berlin | Some CMPs guess the region from it. |
| List localStorage keys | on | Names (never values) of localStorage entries written before consent. |
| Respect robots.txt when crawling | on | Applies to crawled pages; start URLs are always opened. |
| Page load timeout | 45 s | |
| Parallel browser pages | 3 | Scales down automatically when memory is short. |
| Proxy configuration | none | Use an EU country for realistic GDPR results (see above). |

### Output example (shortened)

```json
{
  "url": "https://www.example-shop.de/",
  "finalUrl": "https://www.example-shop.de/",
  "statusCode": 200,
  "pageTitle": "Example Shop",
  "cmpDetected": true,
  "cmps": ["Cookiebot"],
  "cmpDetails": [{ "name": "Cookiebot", "bannerVisible": true, "evidence": ["window.Cookiebot", "element #CybotCookiebotDialog", "request to cookiebot.com"] }],
  "tcfApi": { "present": false },
  "consentBannerVisible": true,
  "riskLevel": "high",
  "issueCount": 3,
  "issues": [
    { "severity": "high", "code": "ANALYTICS_COOKIE_BEFORE_CONSENT", "message": "3 analytics cookie(s) set before any consent: _ga, _ga_4SBCRNPYYR, _hjSession_3357678. …", "items": ["_ga (.example-shop.de)", "…"] },
    { "severity": "medium", "code": "ANALYTICS_REQUEST_BEFORE_CONSENT", "message": "Requests to 2 analytics/tag-manager domain(s) before consent: Google Analytics, Google Tag Manager.", "items": ["google-analytics.com", "googletagmanager.com"] },
    { "severity": "medium", "code": "GOOGLE_FONTS_REMOTE", "message": "Google Fonts are loaded from Google servers before consent – …" }
  ],
  "cookiesBeforeConsent": { "total": 5, "necessary": 2, "functional": 0, "analytics": 3, "marketing": 0, "unknown": 0, "firstParty": 5, "thirdParty": 0 },
  "cookies": [
    { "name": "_ga", "domain": ".example-shop.de", "path": "/", "party": "first-party", "category": "analytics", "service": "Google Analytics", "classifiedBy": "cookie-name", "session": false, "expires": "2027-12-23T10:12:01.000Z", "lifetimeDays": 400, "secure": false, "httpOnly": false, "sameSite": "Lax", "partitioned": false },
    { "name": "CookieConsent", "domain": "www.example-shop.de", "path": "/", "party": "first-party", "category": "necessary", "service": "Cookiebot", "classifiedBy": "cookie-name", "session": false, "expires": "2027-11-18T10:12:00.000Z", "lifetimeDays": 365, "secure": true, "httpOnly": false, "sameSite": "Lax", "partitioned": false }
  ],
  "thirdPartyDomainsByCategory": { "total": 4, "necessary": 1, "functional": 1, "analytics": 2, "marketing": 0, "unknown": 0 },
  "thirdPartyDomains": [
    { "domain": "google-analytics.com", "category": "analytics", "service": "Google Analytics", "requestCount": 2, "hosts": ["region1.google-analytics.com"], "hostCount": 1, "resourceTypes": ["fetch"] },
    { "domain": "googleapis.com", "category": "functional", "service": "Google Fonts", "requestCount": 1, "hosts": ["fonts.googleapis.com"], "hostCount": 1, "resourceTypes": ["stylesheet"] }
  ],
  "googleConsentMode": { "detected": false },
  "localStorageKeys": ["cb_experiments"],
  "requestCount": 96,
  "crawlDepth": 0,
  "browserLocale": "de-DE",
  "visitorCountry": "DE",
  "euVisitor": true,
  "scannedAt": "2026-11-18T10:12:05.312Z",
  "disclaimer": "Automated technical snapshot of the state before any consent interaction. Not legal advice.",
  "error": null
}
```

Pages that could not be scanned (HTTP 4xx/5xx, DNS errors, timeouts, proxy errors, non-HTML files, invalid input) produce a row with `errorCode` and `error`. The **Overview** table shows URL, risk, CMP, cookie counts per category, third-party domain counts and the number of issues. The run summary (key-value store record `RUN-SUMMARY`) adds totals per risk level, detected CMPs, the most frequent tracking services and issue codes.

### Pricing and speed

See the **Pricing** tab. You pay per scanned page; **rows for pages that could not be scanned are free**. Duplicates are removed. You can set a maximum cost per run – the Actor stops cleanly when it is reached.

The Actor runs a real browser (default 2 GB memory). Each page needs its load time plus up to 10 s network idle plus the extra wait (4 s by default). In a cloud test, 10 large German shop and news home pages took 3 minutes with 3 parallel pages (about 0.1 compute units). If you select the Apify proxy group *RESIDENTIAL*, pages are charged with the separate, higher-priced event "Page scanned via Apify residential proxy", which already includes the residential proxy traffic. Other proxy settings use the normal per-page price.

### Classification data, licence and privacy

- The cookie and domain rules are an **own, curated list** (about 600 cookie names/patterns, 360 domains and 20 CMP signatures) compiled from vendors' public documentation and our own test scans. **No third-party cookie database is used** (in particular no GPL or non-commercial lists). Unknown cookies are reported as `unknown` instead of guessed.
- Categories follow the common CMP scheme: *necessary* (security, session, load balancing, consent storage, payment), *functional* (preferences, chat, CDNs, fonts, embeds without tracking), *analytics* (statistics, A/B tests, session recording, tag managers), *marketing* (advertising, retargeting, social pixels, ad-tech ID syncing).
- **No cookie values, no page content, no screenshots** are stored – only cookie metadata, domain names, the page title and localStorage key names. No forms are submitted, no logins.
- The visitor country is determined via `https://www.cloudflare.com/cdn-cgi/trace` (a public Cloudflare endpoint) through the same browser and proxy.
- The browser presents itself with a common desktop browser fingerprint, because many websites block headless browsers. Please scan only websites you own or are allowed to test. Private and internal addresses are refused.
- This Actor is **not affiliated with or endorsed by** any of the CMP vendors, trackers or authorities mentioned.

### Limits

- The scan shows the state **before consent only**. It does not click "accept" or "reject" and therefore cannot verify that a rejection is respected.
- Classification is rule-based. Cookies with generic names (e.g. `id`, `uid`) are only classified on the vendor's domain; custom first-party cookies are usually `unknown`.
- Server-side tracking (e.g. a server-side tag manager on a first-party subdomain) is only visible through the cookies it sets.
- `localStorage` keys are listed for the main page only; IndexedDB, sessionStorage and fingerprinting techniques are not analysed.
- Sites with strong bot protection may answer with 403 (free row); a proxy can help.
- Crawling follows `<a href>` links on the same host only.

### Kurz auf Deutsch

**Cookie Consent Scanner** zeigt, welche Cookies und Tracker eine Website setzt bzw. lädt, **bevor** der Besucher eingewilligt hat. Jede Seite wird in einem frischen Headless-Chrome-Profil geöffnet, der Cookie-Banner wird **nicht** angeklickt. Ergebnis pro Seite: erkanntes Consent-Tool (Usercentrics, Cookiebot, OneTrust, Borlabs, Consentmanager, CCM19, Didomi, Klaro, IAB TCF u. a.), alle Cookies mit Domain, Laufzeit und Flags (ohne Werte) und alle Drittanbieter-Domains – jeweils eingeordnet als notwendig, funktional, Statistik, Marketing oder unbekannt – sowie konkrete Hinweise wie „Marketing-Cookie vor Einwilligung“ oder „Google Fonts von Google-Servern geladen“.

Für eine Prüfung nach DSGVO und § 25 TDDDG (früher TTDSG) sollte ein **Proxy mit Standort Deutschland/EU** gewählt werden, da viele Consent-Tools Besuchern außerhalb der EU keinen Banner zeigen. **Das Ergebnis ist eine technische Momentaufnahme und keine Rechtsberatung.** Abgerechnet wird pro gescannter Seite; nicht erreichbare Seiten sind kostenlos.

Questions or feature requests? Please open an issue in the **Issues** tab.

# Actor input Schema

## `startUrls` (type: `array`):

Pages to scan, one per line (e.g. https://www.example.com). Bare domains are opened as https://domain/. Each page is opened in a fresh headless Chromium profile and the consent banner is NOT touched, so you see what happens before consent.

## `crawlSameDomain` (type: `boolean`):

Follow links on the scanned pages to other pages of the same website (same host, "www." ignored) until "Maximum pages" is reached. Every page is scanned in its own fresh browser profile.

## `maxPages` (type: `integer`):

Upper limit for scanned pages in this run (start URLs plus crawled pages). You pay per scanned page, so this also caps the cost.

## `waitAfterLoadSecs` (type: `integer`):

Extra time after the load event and network idle (max. 10 s) before cookies are read. Many tags fire with a delay; longer waits find more, shorter waits are faster.

## `browserLocale` (type: `string`):

Language the browser announces (Accept-Language, navigator.language), e.g. de-DE, en-GB, fr-FR. Some consent tools decide by language whether to show the banner. The visitor's country is decided by IP address – use a proxy with an EU country for a realistic EU check.

## `timezoneId` (type: `string`):

IANA time zone of the browser, e.g. Europe/Berlin. Some consent tools use it to guess the visitor's region.

## `includeLocalStorage` (type: `boolean`):

Also list the names (never the values) of localStorage entries the page wrote before consent. § 25 TDDDG/TTDSG covers any storage on the device, not only cookies.

## `respectRobotsTxt` (type: `boolean`):

Pages found by the crawl that robots.txt disallows are skipped. The start URLs are always opened, like a visitor would.

## `pageTimeoutSecs` (type: `integer`):

Pages that do not load within this time are retried and then reported as a free error row.

## `maxConcurrency` (type: `integer`):

Maximum pages scanned at the same time (1–10). The Actor scales down automatically when memory or CPU is short.

## `proxyConfiguration` (type: `object`):

Optional. Apify runs in the USA/EU data centres; many consent tools show their banner (and block tags) only for EU visitors. Choose a proxy with an EU country (e.g. Germany) to see what an EU visitor gets, or if a site blocks cloud servers.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.heise.de/",
    "https://www.theguardian.com/international"
  ],
  "crawlSameDomain": false,
  "maxPages": 10,
  "waitAfterLoadSecs": 4,
  "browserLocale": "de-DE",
  "timezoneId": "Europe/Berlin",
  "includeLocalStorage": true,
  "respectRobotsTxt": true,
  "pageTimeoutSecs": 45,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

One item per scanned page with CMP detection, cookies and third-party domains before consent, and issues (plus free rows for pages that could not be scanned).

## `summary` (type: `string`):

Totals per risk level, detected CMPs, most frequent tracking services and issue codes.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrls": [
        "https://www.heise.de/",
        "https://www.theguardian.com/international"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("adamplaenitz/cookie-consent-scanner").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "startUrls": [
        "https://www.heise.de/",
        "https://www.theguardian.com/international",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("adamplaenitz/cookie-consent-scanner").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrls": [
    "https://www.heise.de/",
    "https://www.theguardian.com/international"
  ]
}' |
apify call adamplaenitz/cookie-consent-scanner --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,adamplaenitz/cookie-consent-scanner"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/ImnO2To19aVY61Hk0/builds/fYGIu2JRoanBqgQc7/openapi.json
