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.

While tracking bots can be useful for SEO analysis, security investigations, and understanding crawler behaviour, it can make reports more difficult to interpret, particularly on websites that receive significant bot or spam traffic. And for Cloud users, it can increase tracked hit usage.

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.

  1. 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.
  2. To reduce spam or unwanted bot traffic in your analytics reports, refer to the following configuration guides:
  3. 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.
  4. 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

  1. Open your Tag Manager container and go to Variables.
  2. Edit the Matomo Configuration Variable used to manage Matomo tracking settings.
  3. Enable the Track bots option. This adds the bots=1 parameter so Matomo records the identified bot requests instead of excluding them.
  4. You can also configure custom rules in your setup, such as flag requests with certain headers, IP ranges, or specific behaviours as bot traffic.
  5. For example, define a Variable (e.g., Custom JavaScript Variable) to check for bot-related attributes like specific user-agent strings.
  6. Create a Trigger that fires when the variable meets your bot criteria.
  7. Apply this trigger to a Matomo Analytics Tag for tracking.
  8. 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.