From e6dec00980f46fbc906b369b102012acfc53d8f7 Mon Sep 17 00:00:00 2001 From: benakamoorthi <benaka.moorthi@gmail.com> Date: Mon, 24 Dec 2012 05:12:54 +0000 Subject: [PATCH] Fixes #3582, apply hide/show metrics to metrics docs & metrics in processed reports. git-svn-id: http://dev.piwik.org/svn/trunk@7697 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- plugins/API/API.php | 4 ++++ ...isits_hideColumns___API.getProcessedReport_day.xml | 10 +--------- ...hProcessedMetrics___API.getProcessedReport_day.xml | 11 ----------- ...isits_showColumns___API.getProcessedReport_day.xml | 8 +------- 4 files changed, 6 insertions(+), 27 deletions(-) diff --git a/plugins/API/API.php b/plugins/API/API.php index 6365cc7cb2..ee6ca4c80c 100644 --- a/plugins/API/API.php +++ b/plugins/API/API.php @@ -558,6 +558,10 @@ class Piwik_API_API // set metric documentation to default if it's not set $availableReport['metricsDocumentation'] = $this->getDefaultMetricsDocumentation(); } + + // if hide/show columns specified, hide/show metrics & docs + $availableReport['metrics'] = $this->hideShowMetrics($availableReport['metrics']); + $availableReport['metricsDocumentation'] = $this->hideShowMetrics($availableReport['metricsDocumentation']); } // Some plugins need to add custom metrics after all plugins hooked in diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml index c91c91806b..013f13208a 100755 --- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml +++ b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_hideColumns___API.getProcessedReport_day.xml @@ -9,17 +9,9 @@ <action>getPageTitles</action> <dimension>Page Name</dimension> <metrics> - <nb_hits>Pageviews</nb_hits> - <nb_visits>Unique Pageviews</nb_visits> - <bounce_rate>Bounce Rate</bounce_rate> - <avg_time_on_page>Avg. time on page</avg_time_on_page> <exit_rate>Exit rate</exit_rate> </metrics> <metricsDocumentation> - <nb_hits>The number of times this page was visited.</nb_hits> - <nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits> - <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate> - <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page> <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate> </metricsDocumentation> <documentation>This report contains information about the titles of the pages that have been visited. <br /> The page title is the HTML <title> Tag that most browsers show in their window title.</documentation> @@ -52,7 +44,7 @@ </reportData> <reportMetadata> <row> - + <idsubdatatable>6</idsubdatatable> </row> </reportMetadata> </result> \ No newline at end of file diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml index e480244164..b8bae387af 100755 --- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml +++ b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumnsWithProcessedMetrics___API.getProcessedReport_day.xml @@ -12,8 +12,6 @@ <constantRowsCount>1</constantRowsCount> <metrics> <nb_visits>Visits</nb_visits> - <nb_uniq_visitors>Unique visitors</nb_uniq_visitors> - <nb_actions>Actions</nb_actions> </metrics> <processedMetrics> <nb_actions_per_visit>Actions per Visit</nb_actions_per_visit> @@ -22,15 +20,6 @@ </processedMetrics> <metricsDocumentation> <nb_visits>If a visitor comes to your website for the first time or if he visits a page more than 30 minutes after his last page view, this will be recorded as a new visit.</nb_visits> - <nb_uniq_visitors>The number of unduplicated visitors coming to your website. Every user is only counted once, even if he visits the website multiple times a day.</nb_uniq_visitors> - <nb_actions>The number of actions performed by your visitors. Actions can be page views, downloads or outlinks.</nb_actions> - <nb_actions_per_visit>The average number of actions (page views, downloads or outlinks) that were performed during the visits.</nb_actions_per_visit> - <avg_time_on_site>The average duration of a visit.</avg_time_on_site> - <bounce_rate>The percentage of visits that only had a single pageview. This means, that the visitor left the website directly from the entrance page.</bounce_rate> - <conversion_rate>The percentage of visits that triggered a goal conversion.</conversion_rate> - <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page> - <nb_hits>The number of times this page was visited.</nb_hits> - <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate> </metricsDocumentation> <metricsGoal> <nb_conversions>Conversions</nb_conversions> diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml index 74904951ed..f376b71380 100755 --- a/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml +++ b/tests/PHPUnit/Integration/expected/test_OneVisitorTwoVisits_showColumns___API.getProcessedReport_day.xml @@ -10,17 +10,11 @@ <dimension>Page Name</dimension> <metrics> <nb_hits>Pageviews</nb_hits> - <nb_visits>Unique Pageviews</nb_visits> <bounce_rate>Bounce Rate</bounce_rate> - <avg_time_on_page>Avg. time on page</avg_time_on_page> - <exit_rate>Exit rate</exit_rate> </metrics> <metricsDocumentation> <nb_hits>The number of times this page was visited.</nb_hits> - <nb_visits>The number of visits that included this page. If a page was viewed multiple times during one visit, it is only counted once.</nb_visits> <bounce_rate>The percentage of visits that started on this page and left the website straight away.</bounce_rate> - <avg_time_on_page>The average amount of time visitors spent on this page (only the page, not the entire website).</avg_time_on_page> - <exit_rate>The percentage of visits that left the website after viewing this page.</exit_rate> </metricsDocumentation> <documentation>This report contains information about the titles of the pages that have been visited. <br /> The page title is the HTML <title> Tag that most browsers show in their window title.</documentation> <actionToLoadSubTables>getPageTitles</actionToLoadSubTables> @@ -57,7 +51,7 @@ </reportData> <reportMetadata> <row> - + <idsubdatatable>6</idsubdatatable> </row> </reportMetadata> </result> \ No newline at end of file -- GitLab