Skip to main content

For AI agents: a Markdown version of this page is at https://docs.snowplow.io/docs/pipeline/enrichments/available-enrichments/bot-detection-enrichment.md. The index of all documentation pages is at https://docs.snowplow.io/llms.txt, and the index for this section is at https://docs.snowplow.io/docs/cdi/llms.txt.

Bot detection enrichment

Applies to Enrich 6.9.0+Latest: 6.14.1

Multiple enrichments can independently detect bots: YAUAA, IAB, and the ASN lookup. In addition, the bot detection tracker plugin for web can detect automated browsers client-side.

The bot detection enrichment consolidates these indicators into a single entity. This lets you filter bot traffic in your data models, or drop bot events entirely using a JavaScript enrichment.

How bot indicators are combined​

The enrichment uses "any positive = bot" logic. If any of the enabled sources flags the event as coming from a bot, the event is classified as a bot. A negative result from one source doesn't override a positive result from another. This is because none of the existing enrichments can produce a strong "not a bot" result.

Each source contributes an indicator as follows:

SourceFlagged as bot when
YAUAAdeviceClass is "Robot", "Robot Mobile", or "Robot Imitator", or agentClass is "Robot" or "Robot Mobile" in the YAUAA entity
IABspiderOrRobot is true in the IAB entity
ASN lookuplikelyBot is true in the ASN entity
Client-side detectionbot is true in the client-side bot detection entity

For example, if YAUAA detects a bot based on user agent but IAB doesn't, the event is still classified as a bot. Similarly, if the ASN lookup flags the event based on a known bad ASN, that result stands regardless of what YAUAA or IAB report.

Missing sources

It's safe to enable all sources - useYauaa, useIab, useAsnLookups, useClientSideDetection - even if some of the underlying enrichments or plugins aren't in use. If a contributing source isn't enabled or its entity isn't present, that source is silently skipped.

Configuration​

The enrichment takes these parameters:

NameTypeRequiredSinceDescription
useYauaabooleanRequired

Whether to use YAUAA deviceClass and agentClass as a bot signal.

useIabbooleanRequired

Whether to use IAB spiders and robots as a bot signal.

useAsnLookupsbooleanRequired

Whether to use ASN lookups as a bot signal.

useClientSideDetectionbooleanRequired6.10.0

Whether to use the client-side bot detection tracker plugin as a bot signal.

Configure the parameters in the Console enrichment editor. For example:

json
{
"useYauaa": true,
"useIab": true,
"useAsnLookups": true,
"useClientSideDetection": true
}
Testing with Micro

Unsure if your enrichment configuration is correct or works as expected? You can easily test it using Snowplow Micro, either through Console or on your machine.

The useClientSideDetection parameter needs Enrich 6.10.0 or later. Applies to Enrich 6.10.0+Latest: 6.14.1

Output​

The enrichment produces a bot_detection entity that summarizes all bot indicators for the event. It adds this entity to all events, even when no bot is detected.

bot_detection

Entity
Schema for bot detection context generated by the Bot Detection enrichment
Schema URIiglu:com.snowplowanalytics.snowplow/bot_detection/jsonschema/1-0-1
Example data
json
{
"bot": true,
"indicators": [
"yauaa",
"clientSideDetection"
]
}
Properties and schema
PropertyDescription
bot
boolean
Required. Whether the event is classified as coming from a bot
indicators
array
Required. List of sources that indicated bot activity

Was this page helpful?