Skip to main content

Detect bots on the web

The bot detection plugin uses FingerprintJS BotD to detect automated browsers such as Selenium, PhantomJS, or headless Chrome. It attaches a client_side_bot_detection entity to every event.

This is useful when you want to identify bot traffic as early as possible, before events reach your pipeline. For a broader approach that also incorporates server-side indicators, see the bot detection enrichment.

note

The plugin is available since version 4.7 of the tracker.

The bot detection entity is automatically tracked once configured.

Install the plugin​

Tracker DistributionIncluded
sp.js❌
sp.lite.js❌

Download:

Download from GitHub Releases (Recommended)Github Releases (plugins.umd.zip)
Available on jsDelivrjsDelivr
Available on unpkgunpkg
note

The links to the CDNs above are pinned to a specific version at the time of writing. Check the plugin's GitHub releases for newer versions, and update the pinned version when you upgrade.

javascript
window.snowplow('addPlugin',
"https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-bot-detection@4.10.2/dist/index.umd.min.js",
["snowplowBotDetection", "BotDetectionPlugin"]
);

Output​

The plugin attaches a client_side_bot_detection entity to every event.

client_side_bot_detection

Schema
Schema for bot detection entity, powered by the BotD library (https://github.com/fingerprintjs/BotD)
Schema URIiglu:com.snowplowanalytics.snowplow/client_side_bot_detection/jsonschema/1-0-0
Example data
json
{
"bot": true,
"kind": "headless_chrome"
}
Properties and schema
PropertyDescription
bot
boolean
Required. Whether the current browser is identified as a bot
kind
string
Optional. The type of bot detected. Populated when bot is true, null or omitted otherwise. See https://github.com/fingerprintjs/BotD/blob/main/src/types.ts
Must be one of: awesomium, cef, cefsharp, coachjs, electron, fminer, geb, nightmarejs, phantomas, phantomjs, rhino, selenium, sequentum, slimerjs, webdriverio, webdriver, headless_chrome, unknown,
Asynchronous detection

Bot detection runs asynchronously. Events tracked before detection completes won't have this entity attached. In most cases, detection finishes within milliseconds, but if you need the entity on the very first event, consider deferring your initial tracking calls until the tracker is fully initialized.

The bot detection enrichment can consolidate this client-side indicator with server-side indicators from YAUAA, IAB, and ASN lookups into a single bot_detection entity.

On this page

Try Snowplow Free for 14 Days

Collect behavioral data and act on it in real time. Design a schema, send an event, and fetch live context with the AI Assistant and MCP server.

Want to see a custom demo instead? Book a demo