sorting - Google analytics API gapi - SORT by visitCount wrong way -
i have little problem, use gapi class information google analytics.
the problem when sorting dimensions: visitcount it's sort this:
1,10,11,12,2,3,4,5,50,6,7,8,9
i don't understand, because if sort example: visits sorts right, 10 1,2,3,4,5,6,7,8,10,11
and i've tried desort like: -visitcount still same other way.
anyone know problem is?, or google don't allow it?
and code simple, there nothing see: define('sort', 'visitcount');
this because ga:visitcount dimension , such treated string (i.e. text). whereas ga:visits metric , treated number.
in case of ga:visitcount, when sort numbers represented string order have described. 1, 10, 11, 12, 2 , on. actual correct sorting strings/text. fix first need convert these numbers (integers) , sort or carry out other applicable solution.
Comments
Post a Comment