Pageviews per country and device type

I need get pageviews, country code and devicetyp of a set of URL’s .
I’m testing different method of the API but I’m anoyed with results.

First: I use method UserCountry.getCountry to konw where the visits are from. Using the segment pageUrl.

Second: For each country of the first step I use method DevicesDetection.getType to get visits per device type. Using the segmente countryCode and pageUrl.

Finally: I loop between devicetypes and I make request to method Actions.getPageUrl using the segments deviceType, countryCode and using pageUrl parameter.

The problem with this method is that while in second step I had 2 visits from desktop and 7 from smartphone, when I made the request in the last step using segments ther request for some devicetypes and acountrycode is empty. How is possible?

I can’t believe this is the best way to get this data, I find it very difficult. To get the same info en Google Analytics you only have to select a metric and two dimensions. Thats all.

Can you help me to find the best way to get this information?

What if you create a custom report?

Also be careful, segment IS NOT a filter on actions, but on visits. So if a user visited page A and page B, if you segment on page A, the user will have 2 page views (page A and page B).

Thank you very much for the reply.

The truth is that it would be great to have that extension of the application but it is not easy to manage in my organization.

Without that plugin there is no way to get this information?