Create segments to identify bot traffic in Matomo
Bots, crawlers, and other automated traffic can inflate visit counts, distort engagement metrics, and make it more difficult to measure genuine visitor behaviour. You can create segments in Matomo to identify visits that are likely to originate from bots, crawlers, scripts, or other automated systems.
The reports help to investigate suspicious traffic, estimate its impact on your reports, and determine whether additional filtering or exclusion rules are needed.
This guide provides example segments based on common characteristics associated with bot traffic.
Segments and conditions
Create one or more of the following segments to identify visits that are likely to originate from bots or other automated traffic. See how to build custom segments.
The following segments use behavioural and technical indicators and provided thresholds are examples only. Review your website’s typical visitor behaviour and adjust the conditions to reduce false positives.
Basic bot traffic
Best suited for initial investigations and quick checks. This helps to identify visits with unusually high activity in a very short time. Note that it could include automated testing tools or scripted monitoring.
Define conditions:
- Actions in Visit ≥
20 - Visit Duration ≤
10seconds - Bounce Rate =
100%
Technical and behavioural bot traffic
Best suited for ongoing traffic quality analysis and it combines technical indicators with behaviour. This could include privacy-focused browsers or visitors with limited browser capabilities.
Define conditions:
- Browser or Operating System =
Unknown - Resolution =
Unknown - Actions in Visit ≥
10 - Visit Duration ≤
15seconds - Events =
0
Likely crawler or automated traffic
Best suited for investigating suspicious traffic or excluding likely bots from analysis. No single condition identifies a bot, so it is recommended to combine multiple indicators to reduce false positives.
Define conditions:
- Browser or Operating System =
Unknown - Referrer Type =
Direct Entry(where appropriate) - Visit Number =
1 - Actions in Visit ≥
10 - Visit Duration ≤
15seconds - Events =
0 - Conversions =
0
Note: When you create a new segment, Matomo may need time to process historical reports for that segment. Read more about Are Matomo reports in real time?
After identifying bot traffic
Once you have segmented suspected bot traffic with a segment, review the visits to determine whether they share common characteristics, such as user agents, IP ranges, or request headers.
If the traffic is confirmed to be unwanted, create traffic exclusion rules to prevent similar visits from being tracked in the future. Test exclusion rules carefully before deploying them, as excluded visits cannot be recovered.
1. Reduce bot and spam traffic before it reaches your reports
Tracking Spam Prevention helps reduce known spam and bot traffic before it is processed by Matomo. To review the current settings, go to Administration > System > General settings and scroll to Tracking Spam Prevention.
For configuration guidance, see Block spam and bot traffic with Tracking Spam Prevention.
2. Exclude specific user agents
If you want to permanently exclude requests from specific user agents, such as custom bots or internal testing tools, do not use a segment. Instead, go to your Websites > Settings and add the user agents to the Global list of user agents to exclude.
No single segment or condition can reliably identify all bot traffic. Use these examples as a starting point. You can then review the results regularly refine the conditions to match your website’s traffic patterns and prevent unwanted traffic from affecting your reports.