Skip to content

feat: stop counting bots and headless crawlers in Umami - #29

Merged
robbeverhelst merged 1 commit into
mainfrom
umami-bots
Sep 27, 2026
Merged

robbeverhelst merged 1 commit into
mainfrom
umami-bots

Conversation

@robbeverhelst

Copy link
Copy Markdown
Contributor

Nearly every visitor Umami counted on docs.sluiceway.dev besides the owner was a headless crawler: a stock Chrome, Edge or Safari user agent, a screen of exactly 800x600 (once 1024x1024), no clicks.

  • src/lib/automated.ts: the shared rule, the same as in sluiceway/landing and sluiceway/app. A visit is automated when navigator.webdriver is true, the user agent names a bot, crawler, spider, headless browser or link preview service, or the screen is exactly 800x600 or 1024x1024.
  • src/lib/analytics.ts: an automated visit gets no Umami script and sends no event (automated(), next to Do Not Track's blocked()). Page feedback from one says it was not sent.
  • src/content/docs/privacy.mdx: a new "Automated visitors" section says these visits are not counted and by which signs.
  • Tests: test/automated.test.ts (the rule, on crawlers, previews and people), test/analytics.test.ts (no script and no events for each sign), test/analytics-built.test.ts (the built pages check for automation).
  • The Lighthouse job no longer loads the script: Lighthouse names itself in its user agent.

Nothing in Umami itself changes.

🤖 Generated with Claude Code

Nearly every visitor Umami counted besides the owner was a headless
crawler: a stock Chrome, Edge or Safari user agent on a screen of exactly
800x600 (once 1024x1024), with no clicks. The docs now load no Umami
script and send no event when navigator.webdriver is true, the user agent
names a bot, crawler, spider, headless browser or link preview service, or
the screen is exactly 800x600 or 1024x1024. The rule is
src/lib/automated.ts, the same as in sluiceway/landing and sluiceway/app.

The privacy page gains a section saying automated visitors are not
counted, and page feedback from an automated browser says it was not sent.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@robbeverhelst
robbeverhelst merged commit 02942b7 into main Sep 27, 2026
4 checks passed
@robbeverhelst
robbeverhelst deleted the umami-bots branch September 27, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant