Skip to main content

Bot detection enrichment

Availability

This enrichment is available since version 6.9.0 of Enrich.

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:

ParameterRequiredDescription
useYauaaWhether to use YAUAA deviceClass/agentClass as a bot signal.
useIabWhether to use IAB spiders and robots as a bot signal.
useAsnLookupsWhether to use ASN lookups as a bot signal.
useClientSideDetectionWhether 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 is available since Enrich 6.10.0.

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

On this page

Want to see a custom demo?

Our technical experts are here to help.