Repository navigation
feat: stop counting bots and headless crawlers in Umami - #29
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 whennavigator.webdriveris 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'sblocked()). 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.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).Nothing in Umami itself changes.
🤖 Generated with Claude Code