Does Matomo track search engine bots or other spider / robots?
By default, Matomo excludes requests from visitor analytics that are identified as bots or crawlers. If you want to analyse search engine crawlers, SEO tools, monitoring services, or other automated traffic, follow the guidance below to enable bot tracking.
This guide explains how to track bots using the bots=1 parameter. The parameter tells Matomo to record tracking requests that have been identified as bots instead of excluding them.
Important: The bots=1 parameter does not cause bots to send tracking requests. It only prevents Matomo from excluding requests that have already reached the Tracking API and have been identified as bots.
Before you start
First, identify the type of traffic you want to measure before enabling bot tracking.
- To track search engine crawlers like Googlebot or Bingbot, SEO crawlers, malicious bots, or spam traffic in your website analytics, you can enable bot tracking using
bots=1. - To reduce spam or unwanted bot traffic in your analytics reports, refer to the following configuration guides:
- Define traffic exclusions and exclude new bots from being tracked.
- Block spam and bot traffic with Tracking Spam Prevention.
- Manage Hits usage for Matomo Cloud.
- To analyse AI crawlers (chatbots) such as ChatGPT, Claude, Gemini, or Perplexity that request content directly from your server, configure AI chatbot tracking in Matomo. These requests are tracked separately from website visits.
- To track people who click a link from AI assistants in a chat response and then visit your website, read the Acquisition AI Assistants guide. These visitors are tracked as normal website visits.
Most websites choose to exclude search engine crawlers, monitoring tools, spam bots, and other automated traffic from visitor analytics.
How to track bots in Matomo
Matomo Tag Manager
- Open your Tag Manager container and go to Variables.
- Edit the Matomo Configuration Variable used to manage Matomo tracking settings.
- Enable the Track bots option. This adds the
bots=1parameter so Matomo records the identified bot requests instead of excluding them. - You can also configure custom rules in your setup, such as flag requests with certain headers, IP ranges, or specific behaviours as bot traffic.
- For example, define a Variable (e.g., Custom JavaScript Variable) to check for bot-related attributes like specific user-agent strings.
- Create a Trigger that fires when the variable meets your bot criteria.
- Apply this trigger to a Matomo Analytics Tag for tracking.
- Publish the updated container.
JavaScript tracking code
To record bot requests when using the JavaScript Tracker, add the following line to your tracking code:
_paq.push(['appendToTrackingUrl', 'bots=1']);.
This appends the bots=1 parameter to every tracking request. When a request is identified as coming from a bot, Matomo records it instead of excluding it.
Image tracker (tracking pixel)
If your website uses the Image Tracker, append &bots=1 to the image URL to record requests identified as bots instead of excluding them.
Use the Tracking HTTP API
If you send tracking requests using the Tracking HTTP API, include the bots=1 parameter in the matomo.php tracking request. This allows Matomo to record requests identified as bots.
Import Web Server Logs
When importing web server logs, use the --enable-bots option to include bot requests in the imported data.
Next steps
By default, Matomo excludes requests identified as bots from visitor analytics. Determine if you need to intentionally track bot activity before including the bots=1 parameter in the tracking request.
To analyse AI chatbots and AI agents, such as ChatGPT, Claude, Gemini, or Perplexity, refer to the AI Assistant guides.