It is possible to segment any analytics report and restrict the data to users who have (or don’t have) a particular IP address, or where the IP address is within a given IP range.

How to select visitors within a certain IP range

For example if you want to restrict your reports to users who have an IP address matching 147.28.*.* then you can create a custom segment and specify the IP range:

  • If you use the Segment editor, create a segment where "Visitor IP at least 147.28.0.0" AND "Visitor IP at most 147.28.255.255". (Note: you can only define one IP range at a time using this technique.)
  • If you use the API, the segment definition will look as follows:
    &segment=visitIp%3E%3D147.28.0.0%3BvisitIp%3C%3D147.28.255.255 (this is the URL encoded value for segment visitIp>=147.28.0.0;visitIp<=147.28.255.255)

How to exclude visitors within a certain IP range

  • Or to create a segment excluding all users within an IP range (for example to view your Matomo reports excluding all your colleagues’ requests), you would create a segment where "Visitor IP is less than 147.28.0.0" OR "Visitor IP is greater than 147.28.255.255".
  • If you use the API, the segment definition will look as follows:
    visitIp%3C%3D147.28.0.0%3BvisitIp%3E%3D147.28.255.255 (this is the URL encoded value for segment visitIp<=147.28.0.0;visitIp>=147.28.255.255)
  • To exclude multiple ranges, you can add additional conditions in pairs of OR conditions, for example:

Instead of using segments, you can also create Custom Reports. This lets you analyze and compare the data faster without having to switch between segments and you can get totally new insights into your data.

Previous FAQ: How do I find a specific visitor log by segmenting on Visitor ID?