Get internal vs. external visits ratio?


we record all visits to our site using Piwik. We don’t filter out certain IPs as we have never done that and so the effect of internal visitors was always included in our stats.

Now, I get pressure from some marketing folks asking how many of our visits are from internal users (with a certain IP range). Is there a way to do this kind of filtering with the API? Or do I need to write a widget for it? If yes, anyone willing to give me some pointers how to get started with it? I would probably need an admin UI where to enter the IP ranges for internal users and a widget showing the number of internal and external visits.

But maybe there is already a solution for that!

the UI isn’t there yet, but you can use the segment api and roll your own widget

Hi Anthon,

thanks for answering. Is the segment API an internal one or can I access it externally?

Ok, that worked, got my data! By the way, it is really strange that there is no API to get the number of visits per day. Getting those numbers would require a seperate API call for each day.

Of course you can request data for many days at once, or for many website at once. Please read the doc at