Plausible: Not Tracking Visits — Fix
The Problem
You deployed Plausible Community Edition, added the tracking script to your site, but the dashboard shows zero visitors. The Realtime view is empty. No pageviews, no referrers, nothing.
This happens when the tracking script fails to load, fails to send data, or Plausible rejects the incoming events. The fix depends on which step is breaking.
The Cause
There are five common causes, in order of likelihood:
- Script not loading — blocked by ad blockers, CSP headers, or incorrect script URL
- CORS misconfiguration — Plausible rejects events from an unexpected origin
- Domain mismatch — the domain in your Plausible site settings doesn’t match the actual page domain
- Plausible not accessible — the instance is down, behind a firewall, or the SSL cert is invalid
- Browser extensions — uBlock Origin, Privacy Badger, and similar tools block analytics scripts
The Fix
Method 1: Verify the Script Loads
Open your website in a browser and check the developer console (F12 → Console tab). Look for errors related to the Plausible script:
# Common error: script blocked
GET https://analytics.example.com/js/script.js net::ERR_BLOCKED_BY_CLIENT
If the script is blocked, your ad blocker is catching it. Try:
- Disable the ad blocker temporarily
- Use a proxied script setup to avoid blocking
Verify the script tag is correct:
<script defer data-domain="yourdomain.com"
src="https://your-plausible-instance.com/js/script.js">
</script>
Common mistakes:
- Wrong Plausible instance URL
- Missing
data-domainattribute - Using
asyncinstead ofdefer(both work, but check the attribute exists)
Method 2: Check the Network Tab
In browser DevTools, go to the Network tab and reload your page. Filter by “plausible” or “script.js”:
- Script request (
/js/script.js): Should return 200. If 404 — your Plausible URL is wrong. If blocked — ad blocker. - Event request (
/api/event): After the script loads, it sends a POST to/api/event. Check this request:- 200 response: Working correctly. Your dashboard should update within 60 seconds.
- 400 response: Check the response body — Plausible will tell you what’s wrong (usually domain mismatch).
- No request at all: The script loaded but didn’t fire. Check for JavaScript errors in the console.
Method 3: Fix Domain Mismatch
Plausible validates the data-domain attribute against the site configured in your dashboard. These must match exactly:
Dashboard site: yourdomain.com
Script data-domain: yourdomain.com ✓
Script data-domain: www.yourdomain.com ✗ (mismatch)
Script data-domain: https://yourdomain.com ✗ (include only the domain, not the protocol)
If your site is accessible at both yourdomain.com and www.yourdomain.com, either:
- Redirect one to the other (recommended), or
- Add both as separate sites in Plausible
Method 4: Check Plausible Instance Health
Verify your Plausible instance is running and accessible:
# Check container status
docker compose ps
# Check Plausible logs
docker compose logs plausible
# Test the API endpoint
curl -I https://your-plausible-instance.com/api/health
Common issues:
- ClickHouse not ready: Plausible depends on ClickHouse. If ClickHouse hasn’t finished starting, events are silently dropped. Check
docker compose logs clickhouse. - SSL certificate invalid: If your Plausible instance uses a self-signed or expired cert, browsers will silently refuse to load the script.
- Port not exposed: Verify port 8000 (default) is mapped correctly in your Docker Compose.
Method 5: Proxy the Script (Bypass Ad Blockers)
Ad blockers maintain filter lists that block known analytics domains and script paths. To bypass this, proxy the Plausible script through your own domain:
Nginx:
location /js/metrics.js {
proxy_pass https://your-plausible-instance.com/js/script.js;
proxy_set_header Host your-plausible-instance.com;
}
location /api/event {
proxy_pass https://your-plausible-instance.com/api/event;
proxy_set_header Host your-plausible-instance.com;
}
Then update your tracking script:
<script defer data-domain="yourdomain.com"
data-api="https://yourdomain.com/api/event"
src="https://yourdomain.com/js/metrics.js">
</script>
Now the script loads from your own domain, bypassing most ad blocker filter lists.
Prevention
- Test tracking immediately after deployment — don’t assume it works. Open a private browser window (no extensions) and visit your site. Check the Plausible Realtime view within 60 seconds.
- Set up the proxy approach from the start if you care about accurate counts. Ad blockers affect 25-40% of tech-savvy visitors.
- Monitor the
/api/healthendpoint with Uptime Kuma to catch Plausible downtime before it creates gaps in your data. - Pin your Plausible version in Docker Compose. Upgrades can introduce configuration changes that break tracking.
Related
Get self-hosting tips in your inbox
Get the Docker Compose configs, hardware picks, and setup shortcuts we don't put in articles. Weekly. No spam.
Comments