Using REST API with segment a range of IPs or a provider string

I’m trying to get the screen resolution of my visitors coming from my local network

I’ve tried the API call using as segment part of the IP, like this

https://MY_HOSTNAME/index.php?format=XML&period=range&date=2011-11-01,2011-12-06&idSite=1&module=API&method=UserSettings.getResolution&segment=visitIp==147.28..&token_auth=<my_token>

This returns an empty result, so it does not recognize the * in the IP

Then I tried as segment my provider string, like this (“Tuc” is the provider as displayed in the web interface)

https://MY_HOSTNAME/index.php?format=XML&period=range&date=2011-11-01,2011-12-06&idSite=1&module=API&method=UserSettings.getResolution&segment=provider==Tuc&token_auth=<my_token>

This also returns an empty result, so it does not recognize the provider string. I’ve also tried other provider strings, also with empty results.

So the question is: how can I get get a segment with a range of IP addresses or use the provider string as segment?

Stefanos

Visit segmenting all visit within an IP range using the segmentation API feature try:


&segment=visitIp>=147.28.0.0;visitIp<=147.28.255.255;

that worked indeed! Hadn’t thought of it. Thanks a lot matt!

Happy New Year! If you are still using Piwik and interested in the awesome new feature of “Creating a Custom Segment in Piwik and apply to reports in Real time!” we need YOUR help, with a little or big donation at: http://crowdfunding.piwik.org/custom-segments-editor/

This will allow to dynamically add or edit, a new set of rules for example “Show all visitors from USA and using Firefox and using Google”. This will be done via a simple to use interface. See screenshots and more info here: http://crowdfunding.piwik.org/custom-segments-editor/

We are crowd funding the future of Piwik and this feature in particular. With your help we can do it.

Thanks

Matthieu