0

I configured 2 custom variables in Piwik. I'm using the API to obtain values ordered by "nb_visists". The request that I used is this:

http://localhost/piwik/?module=API&method=CustomVariables.getCustomVariables&idSite=2&period=range&date=2015-01-19,2015-01-20&format=JSON&filter_sort_column=nb_visits&filter_sort_order=asc&expanded=1&token_auth=......&segment=customVariablePageName2==category;customVariablePageValue2=@/maincategory/

The problem is that the results are not sorted according to the value of "nb_visits" column. When I use the parameter "filter_sort_column" the results are sorted in a different way, but the order is still wrong.

1 Answers1

0

The sorting should work, however in your example you requested 2 days. So you will get 2 results, each having many rows.

Rows will be sorted in each result, but the 2 results will not be sorted.

It can be confusing if you have 1 row per day: in that case, it will seem like the sorting doesn't work, but remember the sorting is done per day.

Matthieu Napoli
  • 48,448
  • 45
  • 173
  • 261
  • Thanks for the replay. I tried to do the same request with this parameter: "date=2015-01-19,2015-01-19" (one day), but the order of the results is still wrong. This is the response: http://notepad.cc/kiosoosmi16 – zetaenzo Feb 02 '15 at 09:40