@ibril15 opened this Issue on November 20th 2019

Hello,

In Email Reports we are able to add Entry Pages and Exit Pages in a report (by URL and by Title). The ordering of these tables is not intuitive. As far as I can tell, the way it works is that it pulls a list of all pages in the time period sorted by number of visits, and then filters out anything that isn't an entry/exit page. That leaves a table with no apparent sort order since there are many frequently popular pages that are not common entry/exit pages.

The tables should be sorted by the data they're displaying: Entrances/Exits descending (in both, the case of displaying the tables by URL and by Title). Can you please confirm this behavior?

Thanks a lot.

image

-Igor

@ibril15 commented on November 21st 2019

Hi Thomas,

Thanks for your review. I'm not sure specifically what defines a "usability" issue, but I would actually consider this simply a "bug". It's not that this table is not "user-friendly", it's that it is essentially unusable. It is showing the most popular pages, but not the most popular "entrance pages". So as a result, in one example I have 5 out of the top 7 results with less than 1,000 entrances, while the 8th has almost 115,000. That makes the data unreliable and not presentable.

image

Thanks a lot.

-Igor

@tsteur commented on November 21st 2019 Member

Marked it as a bug... @ibril15

Marked it as usability cause in the UI you can change the sorted column but this obviously doesn't work for scheduled report

@utrautmann commented on June 7th 2021

@tsteur A customer of mine has the same problem and cannot work meaningfully with the unsorted output in the reports.
Is there an easy way to have the reports sort this list? Sounds like an order statement in SQL?

@tsteur commented on June 7th 2021 Member

Hi @utrautmann it's not a SQL statement issue but it would likely require sorting after filtering actions. Something like the diff below but please note that's just more of a guess I didn't actually test it.

--- a/plugins/Actions/API.php
+++ b/plugins/Actions/API.php
@@ -170,6 +170,7 @@ class API extends \Piwik\Plugin\API

         $dataTable = $this->getPageUrls($idSite, $period, $date, $segment, $expanded, $idSubtable, false, $flat);
         $this->filterNonEntryActions($dataTable);
+        $dataTable->filter('Sort', ['entry_nb_visits']);
         return $dataTable;
     }

@@ -183,6 +184,7 @@ class API extends \Piwik\Plugin\API

         $dataTable = $this->getPageUrls($idSite, $period, $date, $segment, $expanded, $idSubtable, false, $flat);
         $this->filterNonExitActions($dataTable);
+        $dataTable->filter('Sort', ['exit_nb_visits']);
         return $dataTable;
     }

@@ -219,6 +221,7 @@ class API extends \Piwik\Plugin\API

         $dataTable = $this->getPageTitles($idSite, $period, $date, $segment, $expanded, $idSubtable, $flat);
         $this->filterNonEntryActions($dataTable);
+        $dataTable->filter('Sort', ['entry_nb_visits']);
         return $dataTable;
     }

@@ -233,6 +236,7 @@ class API extends \Piwik\Plugin\API

         $dataTable = $this->getPageTitles($idSite, $period, $date, $segment, $expanded, $idSubtable, $flat);
         $this->filterNonExitActions($dataTable);
+        $dataTable->filter('Sort', ['exit_nb_visits']);
         return $dataTable;
     }
@utrautmann commented on July 16th 2021

@tsteur Thank you. Unfortunately, it doesn't help. I patched the API.php but the sort order remains unsorted.

@tsteur commented on July 18th 2021 Member

Thanks for letting us know @utrautmann Looks like it also needs some other changes somewhere.

Powered by GitHub Issue Mirror