Skip to content
Plausible Analytics · Chapter 9 of 14 Day 7: Privacy and Shields

Day 7: Privacy and Shields

Goal: You prove what Plausible stores and what it does not, block visitors with a shield, fix a hostname allowlist that is too narrow and share the dashboard via a secret link. · Duration: approx. 60 min · Prerequisite: Day 6

Briefing

  • Plausible sets no cookies and stores nothing in the browser. It recognizes visitors by a hash of IP, user agent, domain and a salt that, according to the Plausible documentation, is renewed daily. So the same person is a new visitor the next day – by design.
  • What is stored: the hash, the page, the source and values derived from them (country, browser, device) – not the IP and not the full user agent.
  • Shields drop events as soon as they arrive: IP addresses, countries, pages (blocklists) and hostnames (allowlist).
  • Dashboards are private by default. You can make them public or share them via shared links with a secret key.
  • Not legal advice: Whether you need consent for Plausible depends on the law of your country and on your configuration. This chapter shows the technical facts such an assessment relies on.
 Browser ── POST /api/event (IP, user agent in the request) ──► Plausible
             Shield: IP blocked? Hostname allowed? ──► dropped
             user_id = hash(salt of the day + domain + IP + user agent)
             country from IP, browser from user agent ──► ClickHouse (no IP, no UA)
 Browser stores: nothing   (exception: plausible_ignore, if you set it yourself)

Drill 1: What is in ClickHouse – and what is not

# on argo
cd ~/plausible/ce
docker compose exec -T plausible_events_db clickhouse-client -d plausible_events_db \
  --query "select count() from system.columns where database = 'plausible_events_db'
           and table = 'events_v2' and (name ilike '%ip%' or name ilike '%agent%'
           or name ilike '%addr%')"
docker compose exec -T plausible_events_db clickhouse-client -d plausible_events_db \
  --query "select user_id, country_code, browser, operating_system, pathname
           from events_v2 where name = 'pageview' order by timestamp desc limit 2
           format TSV"

Expected (values will differ):

0
16777976725540453820    \0\0    Chrome  GNU/Linux   /books/
10846728212830582644    \0\0    Chrome  GNU/Linux   /coming-soon/

No column for IP address or user agent. country_code is \0\0 (unknown) because the test IPs 203.0.113.x do not belong to any country – a real IP yields DE, US. Browser and operating system are derived from the user agent; the user agent itself is discarded.

Save your progress? Sign up for free

Drill 2: The salt

# on argo
cd ~/plausible/ce
docker compose exec -T plausible_db psql -U postgres -d plausible_db \
  -tAc "select id, length(salt), inserted_at from salts order by id"

Expected (the date will differ):

1|16|2026-11-20 19:44:12

A random 16-byte value, created at the first start. According to the documentation, Plausible generates a new one every day and deletes old ones – yesterday’s hash can then no longer be linked to anyone. If you empty salts with SQL, all of today’s visitors become new ones. The table lives in PostgreSQL, so the salt of the day is also in the dump (Day 8) – protect backups as well as the database itself.

Save your progress? Sign up for free

Drill 3: What stays in the browser

One visit, then a look at everything a website can store in the browser.

# on argo
cd ~/plausible/pw
cat > speicher.js <<'EOF'
// Day 7: visits a page and shows cookies, localStorage and sessionStorage
const { chromium } = require('playwright');
(async () => {
  const b = await chromium.launch(
    { args: ['--disable-blink-features=AutomationControlled'] });
  const ctx = await b.newContext(
    { ignoreHTTPSErrors: true, userAgent: process.env.UA });
  const p = await ctx.newPage();
  await p.goto(process.argv[2]);
  await p.waitForTimeout(2000);
  console.log('cookies:', JSON.stringify(await ctx.cookies()));
  console.log('localStorage:',
    await p.evaluate(() => JSON.stringify(Object.keys(localStorage))));
  console.log('sessionStorage:',
    await p.evaluate(() => JSON.stringify(Object.keys(sessionStorage))));
  await b.close();
})();
EOF
UA="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)"
UA="$UA Chrome/140.0.0.0 Safari/537.36"
docker run --rm --network host --user "$(id -u):$(id -g)" -e HOME=/tmp -e UA="$UA" \
  -v ~/plausible/pw:/pw -w /pw mcr.microsoft.com/playwright:v1.65.0-noble \
  node speicher.js https://itdrills.com/books/

Expected:

cookies: []
localStorage: []
sessionStorage: []

Nothing – not even a cookie from the site itself. That is the technical core of the claim “Plausible needs no cookie banner”: nothing is stored on or read from the device. Whether that is legally sufficient in your case is a separate assessment.

Save your progress? Sign up for free

Drill 4: Blocking a visitor

The office (203.0.113.50) should not skew the statistics.

In the browser: Site settings → Shields → IP addresses → Add IP address, IP 203.0.113.50, Description Büro (office), Add IP address.

Verify: Plausible reloads rules every 30 seconds – wait briefly, then one visit from the office and one from elsewhere.

# on argo
sleep 35
cd ~/plausible/pw
UA="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)"
UA="$UA Chrome/140.0.0.0 Safari/537.36"
for ip in 203.0.113.50 203.0.113.51; do
  printf '%s ' $ip
  docker run --rm --network host --user "$(id -u):$(id -g)" -e HOME=/tmp -e ECHT=1 \
    -e UA="$UA" -e IP=$ip -v ~/plausible/pw:/pw -w /pw \
    mcr.microsoft.com/playwright:v1.65.0-noble \
    node besuch.js https://itdrills.com/coming-soon/ | tail -1
done
cd ~/plausible/ce
docker compose exec -T plausible_db psql -U postgres -d plausible_db \
  -tAc "select inet, description, action from shield_rules_ip"

Expected (verworfen means “dropped”, gezählt means “counted”):

203.0.113.50 <- 202 verworfen
203.0.113.51 <- 202 gezählt
203.0.113.50|Büro|deny

The block applies to the IP that Plausible sees – behind Caddy, that is the one from X-Forwarded-For (Day 4). Without trusted_proxies, an IP block would not work at all: Plausible would only see the VM itself.

Save your progress? Sign up for free

Drill 5: The allowlist that is too narrow

Break it: A colleague wants to exclude test systems and creates a hostname allowlist entry – for the name he has in mind.

In the browser: Shields → Hostnames → Add hostname, type www.itdrills.com, choose Create “www.itdrills.com”, Add hostname.

Symptom:

# on argo
sleep 35
cd ~/plausible/pw
UA="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)"
UA="$UA Chrome/140.0.0.0 Safari/537.36"
docker run --rm --network host --user "$(id -u):$(id -g)" -e HOME=/tmp -e ECHT=1 \
  -e UA="$UA" -e IP=203.0.113.52 -v ~/plausible/pw:/pw -w /pw \
  mcr.microsoft.com/playwright:v1.65.0-noble \
  node besuch.js https://itdrills.com/coming-soon/ | tail -1

Expected (verworfen means “dropped”):

<- 202 verworfen

Investigate:

# on argo
cd ~/plausible/ce
docker compose exec -T plausible_db psql -U postgres -d plausible_db \
  -tAc "select hostname, hostname_pattern, action from shield_rules_hostname"

Expected:

www.itdrills.com|^www\.itdrills\.com$|allow

Cause: As soon as there is one hostname rule, it acts as an allowlist: only exactly these hostnames are counted. But the site runs under itdrills.com.

Fix and verify: Allow itdrills.com as well (Add hostname → itdrills.com).

# on argo
sleep 35
cd ~/plausible/pw
UA="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)"
UA="$UA Chrome/140.0.0.0 Safari/537.36"
docker run --rm --network host --user "$(id -u):$(id -g)" -e HOME=/tmp -e ECHT=1 \
  -e UA="$UA" -e IP=203.0.113.53 -v ~/plausible/pw:/pw -w /pw \
  mcr.microsoft.com/playwright:v1.65.0-noble \
  node besuch.js https://itdrills.com/coming-soon/ | tail -1
cd ~/plausible/ce
docker compose exec -T plausible_db psql -U postgres -d plausible_db \
  -tAc "select hostname from shield_rules_hostname order by hostname"

Expected (gezählt means “counted”):

<- 202 gezählt
itdrills.com
www.itdrills.com

Tip: Instead of adding every name individually: *.itdrills.com covers all subdomains – but not itdrills.com itself. You need both rules.

Save your progress? Sign up for free

Drill 6: Sharing the dashboard

Without logging in, the dashboard is invisible – not “forbidden” but “does not exist”:

# on argo
curl -s -o /dev/null -w '%{http_code}\n' https://plausible.lab/itdrills.com

Expected:

404

A client should be able to follow along without an account. In the browser: Site settings → Visibility → Add shared link, name Kunde (client), Create shared link. Copy the link shown; it looks like this: https://plausible.lab/share/itdrills.com?auth=….

# on argo
cd ~/plausible/ce
A=$(docker compose exec -T plausible_db psql -U postgres -d plausible_db \
  -tAc "select slug from shared_links where name = 'Kunde'")
curl -s -o /dev/null -w 'Link: %{http_code}\n' \
  "https://plausible.lab/share/itdrills.com?auth=$A"
curl -s -o /dev/null -w 'falscher Schlüssel: %{http_code}\n' \
  "https://plausible.lab/share/itdrills.com?auth=falsch"

Expected (falscher Schlüssel means “wrong key”):

Link: 200
falscher Schlüssel: 404

The auth value works like a password. Anyone who has the link sees everything – until you delete it. For more protection, the form also offers a password.

Save your progress? Sign up for free

Exercise: Speed Drills

  1. Show all shield rules (IP and hostname) in one list. Target time: 30 s
  2. Show whether the dashboard is public. Target time: 20 s

Solution

# on argo
cd ~/plausible/ce
docker compose exec -T plausible_db psql -U postgres -d plausible_db -tAc "
  select 'ip', inet::text, action from shield_rules_ip
  union all select 'host', hostname, action from shield_rules_hostname order by 1, 2"
docker compose exec -T plausible_db psql -U postgres -d plausible_db \
  -tAc "select public from sites where domain = 'itdrills.com'"

Expected:

host|itdrills.com|allow
host|www.itdrills.com|allow
ip|203.0.113.50/32|deny
f

Save your progress? Sign up for free

Checkpoint

# on argo
cd ~/plausible/ce
docker compose exec -T plausible_db psql -U postgres -d plausible_db -tAc "
  select (select count(*) from shield_rules_ip), (select count(*) from
  shield_rules_hostname), (select count(*) from shared_links)"
test -f ~/plausible/pw/speicher.js && echo "speicher.js da"

Expected (da means “present”):

1|2|1
speicher.js da

Challenge

Prove that a blocked visit really arrives nowhere: send three requests from the office and show that events_v2 does not gain a single row in that period.

Hint: Note a start time beforehand (Day 4).

Solution

# on argo
cd ~/plausible/pw
UA="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko)"
UA="$UA Chrome/140.0.0.0 Safari/537.36"
T=$(date -u '+%F %T')
for i in 1 2 3; do
  docker run --rm --network host --user "$(id -u):$(id -g)" -e HOME=/tmp -e ECHT=1 \
    -e UA="$UA" -e IP=203.0.113.50 -v ~/plausible/pw:/pw -w /pw \
    mcr.microsoft.com/playwright:v1.65.0-noble \
    node besuch.js https://itdrills.com/books/ >/dev/null
done
sleep 5
cd ~/plausible/ce
docker compose exec -T plausible_events_db clickhouse-client -d plausible_events_db \
  --query "select count() from events_v2 where timestamp >= '$T'"

Expected:

0

Shields act before storage: a blocked request leaves no trace in ClickHouse – unlike a filter in the dashboard, which only hides data.

Save your progress? Sign up for free

Cleanup

The IP block stays (it does no harm), as do the hostname rules and the shared link.

Interview Note

  • How does Plausible count visitors without cookies? A hash of salt, domain, IP and user agent; the salt changes daily, IP and user agent are not stored.
  • Shield or filter? A shield drops before storage, a filter only hides.
  • What happens with the first hostname rule? It turns “everything allowed” into an allowlist – all other hostnames are dropped.

Enterprise Note

  • For the privacy documentation: what is stored (Drill 1), what happens in the browser (Drill 3), where the server is located and who has access – Plausible publishes its own data policy on this; the legal assessment is done by your data protection officer.
  • Maintain shields for office, VPN and monitoring IPs; use a hostname allowlist so that copies of the site (staging, scrapers) do not skew the numbers.
  • Review shared links regularly and protect them with a password; treat them like passwords.
  • Roles: “Viewer” for people who only read along, “Editor” for those who maintain goals; invitations need SMTP (Day 9).

Contents

More