Getting most visited pages via HTTP API, but with details


#1

My site urls look like this(after domain):

/somepage/somedetail
/somepage/someanotherdetail
/somepage/somemoredetail

I use this (php) code to get most visited pages:
$url = “?module=API&method=Actions.getPageUrls&idSite=1&date=yesterday&period=week&format=PHP&filter_limit=10&token_auth=” . $token_auth;
$fetched = file_get_contents($url);
$content = unserialize($fetched);

and the result is basically your most visited page is: /somepage/, then some other pages. but as far as url’s go, piwik doesn’t consider the rest of the url a "different url"
so how can I get most 10 visited pages that start with /somepage/, where I am interested in the last part of that url.

Another question: when I add a “search parameter” as “somepage/” it doesnt work. to register the “/somedetail” part as the search word, how should I add it?

Thanks.


#2

or, if there is a way, how can I have piwik consider /page/1 and /page/2 different urls entirely?


#3

I have exactly the same question. Did you ever figure this out?

EDIT–

I found this post 301 Moved Permanently
which suggests adding flat=1 to the query, and that solves the problem. However it seems a little slow (5-10 seconds), probably because I have a lot of pages (somewhere from a few hundred to a couple thousand).