IPs may be excluded from Matomo tracking for various reasons. The first IPs that are entered are often those of the places where the users are connecte to the website (office, home).
IPs to exclude for all websites
If you manage a Matomo server and deals with several measurable items to track, it is possible to create a global list which will be applied to all devices.
- Go to the Administration dashboard by clicking on the cogwheel icon of the navbar;
- In the Websites section, click on Settings;
- The first available parameter displays the Global list of Excluded IPs field. Enter the IP addresses to be excluded here. Skip a line after each IP.
IPs to exclude for a specific website
You can customise the list of IPs to be excluded for a specific website.
- Go to the Administration dashboard;
- In the Websites section, click on Manage;
- The page displays the list of measurable elements;
- Select the website;
- Scroll down the settings to the Excluded IPs field and enter the IP addresses to be ignored.
Exclude robots and unwanted services
As you may know, websites often have unwanted visitors or known services that you don’t want to include in your Matomo statistics.
In most cases it is possible to isolate and exclude robots by their user agent. However, because some robots use common user agents, you need to be able to exclude them via their IP addresses.
Case study
On the Matomo instance that we use to track traffic of the website Auvergne-Rhône-Alpes Tourisme Pro, we noticed connections from Norway. These connections initiated sessions at regular intervals and only made requests to the home page. Neither the user agent (blink) nor the country of origin of the connection could be used as a filter. All we had was the IP address.
You have certainly chosen to anonymise the IPs of the visitors, and in the vsits log all the IPs end by a 0.
We have to use wildcards.
Mise en application
Exclusion of IPs with network ID 146.247.137 and a host between 130 and 139
146.247.13*
Exclusion of IPs with network ID 146.247.137 and a host between 0 and 255
146.247.137.*
After a few adjustments, we were able to filter out unwanted connections without blocking genuine users connecting from Norway.
Use Matomo segments to exclude robots
Often, it may take a moment before we can identify malicious or undesirable connections and. We need then to use a segment to filter the data already collected.
I hope this post was useful to you, please feel free to share it. You can also read about the other topics related to Matomo.