# Consent & Tracker Check (`educated_aster_2jl/consent-check`) Actor

Prüft eigene Websites: Tracker und Cookies vor der Einwilligung. Strukturiertes Ergebnis je URL. Technische Prüfung, keine Rechtsberatung.

- **URL**: https://apify.com/educated_aster_2jl/consent-check.md
- **Developed by:** [Tobias Wilmsen](https://apify.com/educated_aster_2jl) (community)
- **Categories:** Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## Consent & Tracker Check

> **Technische Prüfung, keine Rechtsberatung. / Technical check only, not legal advice.**

### What it does

This Actor opens public web pages in a headless browser and records what loads **before** a visitor interacts with a consent banner: cookies (names only), localStorage/sessionStorage keys (keys only), third-party and known-tracker requests, CMP/banner signals, Google Consent Mode default signals, remote Google Fonts, and imprint/privacy links.

You get one structured dataset item per URL plus a run summary in the key-value store (`OUTPUT`). Export as JSON, CSV or Excel.

Use it to check **your own websites or websites you manage on behalf of clients** (for example after a release, a tag manager change or a new plugin). Do not use it for sites you neither operate nor have a mandate for.

Findings are technical observations only, for example:

- "cookie set before consent"
- "request to third-party domain without consent"
- "no reject button found in consent banner"

The Actor does **not** assess whether a finding is permitted and makes **no** legal assessment of a site.

### What it checks

Per page (v0.2):

1. **Third-party and tracker requests before consent** – curated host list (GA4/gtag, GTM, Google Ads, Meta Pixel, TikTok, Hotjar, LinkedIn, Microsoft Clarity, Matomo, and others). Each match is labelled with a product id.
2. **Cookies before consent** – names and domains only, no values.
3. **localStorage / sessionStorage before consent** – keys only, no values.
4. **Consent banner / CMP** – Cookiebot, Usercentrics, OneTrust, Borlabs, Complianz, CCM19, Klaro, consentmanager, CookieYes, iubenda, plus a generic heuristic.
5. **Reject button on the first layer** – visible reject / essential-only control.
6. **Google Consent Mode default signals** – presence of `gtag('consent','default',…)` / related markup signals.
7. **Google Fonts loaded remotely** – `fonts.googleapis.com` / `fonts.gstatic.com`.
8. **Imprint and privacy policy links** – heuristic on href and link text.

Each page gets a status of `rot`, `gelb` or `gruen` derived from the technical findings:

- **rot:** at least one tracker request or tracking cookie name before consent
- **gelb:** other observations (remote fonts, no banner, no reject button, missing legal links, scan error)
- **gruen:** no red or yellow findings

The status summarizes observations. It is not a legal assessment.

Banner, button and Consent Mode detection are heuristics. Custom setups can be missed or misread. The Actor never clicks Accept/Reject.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `startUrls` | array (required) | – | Public pages to check, no login. |
| `maxPagesPerDomain` | integer, 1–10 | 1 | Maximum pages per domain. |
| `timeoutSecs` | integer, 5–120 | 30 | Timeout for loading one page. |
| `requestDelayMs` | integer, 0–30000 | 1500 | Delay between page requests. |

Example:

```json
{
  "startUrls": [{ "url": "https://bahrtec.org" }],
  "maxPagesPerDomain": 1,
  "timeoutSecs": 30,
  "requestDelayMs": 1500
}
```

### Output

One dataset item per checked page (`url`, `finalUrl`, `checkedAt`, `httpStatus`, `ampel`, `findings[]`, `summary`, tracker/cookie/storage lists, `consent`, `legalLinks`, `disclaimer`, `error`). Cookie **values** and storage **values** are never stored.

A run summary is written to the key-value store as `OUTPUT` (page counts, ampel counts, per-URL short list, disclaimer).

Sample outputs from own-domain runs: see `samples/`.

### Pricing

Pay per event:

| Event | What triggers it | Price |
|---|---|---|
| `page-checked` | One public page checked successfully | $0.01 |
| `apify-actor-start` | Actor run start, charged per GB of memory (default 2 GB = 2 events), also when a run fails | $0.00005 |

Failed or unreachable pages are not charged for `page-checked`. The start event is charged on every run, including failed runs.

### Limits

- Public pages only. No login, no forms, no paywalled content.
- One snapshot per run; region/device/A-B variants may differ.
- Heuristics can produce false positives or false negatives.
- Never clicks consent controls; does not test the post-consent state.
- Up to 10 pages per domain per run, with a delay between requests.

### Data & privacy

- No screenshots, form contents or cookie/storage values.
- Only names, keys, domains and timestamps.
- Public pages only, with a rate limit.

### Disclaimer

**Technische Prüfung, keine Rechtsberatung.** Technical check only, not legal advice. Findings describe what the browser observed during the run. This Actor does not make a legal assessment.

### FAQ

**Which sites should I check?**
Your own websites or websites you manage on behalf of clients. Do not use it for sites you neither operate nor have a mandate for.

**Does a green result mean my site meets legal requirements?**
No. The Actor only reports technical observations.

**Can I run it on a schedule?**
Yes, with Apify Schedules. Billing is pay-per-event: $0.01 per `page-checked`, $0.00005 per `apify-actor-start` (charged per GB of memory, default 2 GB).

***

### Kurz auf Deutsch

**Technische Prüfung, keine Rechtsberatung.**

Der Actor prüft öffentlich erreichbare Seiten ohne Login und ohne Klick auf ein Consent-Banner. Er hält fest, was vor einer Einwilligung geladen wird: Cookies (nur Namen), localStorage-/sessionStorage-Keys, Anfragen an bekannte Tracker-Domains (mit Produktlabel), Consent-Banner/CMP, Google-Consent-Mode-Default-Signale, Google Fonts sowie Links zu Impressum und Datenschutz. Ampel (`rot`/`gelb`/`gruen`) fasst Beobachtungen zusammen – keine rechtliche Bewertung.

Gespeichert werden nur Namen, Keys, Domains und Zeitpunkte. Preise: $0.01 je geprüfter Seite (`page-checked`), $0.00005 je Actor-Start (`apify-actor-start`, je GB Arbeitsspeicher, Standard 2 GB).

# Actor input Schema

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

Public pages to check without login. Use only your own sites or sites you manage on behalf of a client.

## `maxPagesPerDomain` (type: `integer`):

Maximum pages per domain (rate-limit protection).

## `timeoutSecs` (type: `integer`):

Timeout for loading one page.

## `requestDelayMs` (type: `integer`):

Delay between page requests (rate limit).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://bahrtec.org"
    }
  ],
  "maxPagesPerDomain": 1,
  "timeoutSecs": 30,
  "requestDelayMs": 1500
}
```

# Actor output Schema

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

One item per checked page: trackers, cookies (names only), storage keys, CMP/banner, Consent Mode defaults, fonts, legal links.

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

Summary of the run with traffic-light counts.

# 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": [
        {
            "url": "https://bahrtec.org"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("educated_aster_2jl/consent-check").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": [{ "url": "https://bahrtec.org" }] }

# Run the Actor and wait for it to finish
run = client.actor("educated_aster_2jl/consent-check").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": [
    {
      "url": "https://bahrtec.org"
    }
  ]
}' |
apify call educated_aster_2jl/consent-check --silent --output-dataset

```

## MCP server setup

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

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/rWlEL8IUpqWbD4Pjx/builds/hM2pe6WQjHEPxwe0b/openapi.json
