Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2019-01-22 08:04:41 +0300
committerdiosmosis <diosmosis@users.noreply.github.com>2019-01-22 08:04:41 +0300
commit224caccc8527123b6b0fd3e831122c689c64e707 (patch)
treee1fbb652f04c0b08c45c130f9a32d72af2e8e3e3 /plugins/Goals
parent8d39c9c2b1c3e8645065ced9d7873fc7a86fc1c0 (diff)
Add all goal specific metrics to goal overview (#13906)
* add all goal metrics to goals overview graph * add conversion rates * correctly calculate conversion rate * more fixes * performance tweak * improve performance of getMetric when having heaps of goals * fix conversion rate might not be shown properly * add parameter to fetch all goal metrics
Diffstat (limited to 'plugins/Goals')
-rw-r--r--plugins/Goals/API.php50
-rw-r--r--plugins/Goals/Columns/Metrics/GoalConversionRate.php59
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecific/AverageOrderRevenue.php3
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecific/ConversionRate.php3
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecific/Conversions.php3
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecific/ItemsCount.php3
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecific/Revenue.php3
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecific/RevenuePerVisit.php3
-rw-r--r--plugins/Goals/Columns/Metrics/GoalSpecificProcessedMetric.php5
-rw-r--r--plugins/Goals/Controller.php45
-rw-r--r--plugins/Goals/Goals.php13
-rw-r--r--plugins/Goals/tests/System/TrackGoalsOneConversionPerVisitTest.php17
-rw-r--r--plugins/Goals/tests/System/expected/test_trackGoals_oneConversionPerVisitshowAllGoalSpecificMetrics__Goals.get_day.xml42
-rw-r--r--plugins/Goals/tests/System/expected/test_trackGoals_oneConversionPerVisitshowAllGoalSpecificMetrics_requestedColumns__Goals.get_day.xml6
14 files changed, 229 insertions, 26 deletions
diff --git a/plugins/Goals/API.php b/plugins/Goals/API.php
index 62ebde2c9a..b5a76276cd 100644
--- a/plugins/Goals/API.php
+++ b/plugins/Goals/API.php
@@ -23,6 +23,7 @@ use Piwik\Plugins\API\DataTable\MergeDataTables;
use Piwik\Plugins\CoreHome\Columns\Metrics\ConversionRate;
use Piwik\Plugins\Goals\Columns\Metrics\AverageOrderRevenue;
use Piwik\Plugin\ReportsProvider;
+use Piwik\Plugins\Goals\Columns\Metrics\GoalConversionRate;
use Piwik\Segment;
use Piwik\Segment\SegmentExpression;
use Piwik\Site;
@@ -419,9 +420,10 @@ class API extends \Piwik\Plugin\API
* @param bool $segment
* @param bool|int $idGoal
* @param array $columns Array of metrics to fetch: nb_conversions, conversion_rate, revenue
+ * @param bool $showAllGoalSpecificMetrics whether to show all goal specific metrics when no goal is set
* @return DataTable
*/
- public function get($idSite, $period, $date, $segment = false, $idGoal = false, $columns = array())
+ public function get($idSite, $period, $date, $segment = false, $idGoal = false, $columns = array(), $showAllGoalSpecificMetrics = false)
{
Piwik::checkUserHasViewAccess($idSite);
@@ -445,6 +447,7 @@ class API extends \Piwik\Plugin\API
'date' => $date,
'idGoal' => $idGoal,
'columns' => $columns,
+ 'showAllGoalSpecificMetrics' => $showAllGoalSpecificMetrics,
'format_metrics' => Common::getRequestVar('format_metrics', 'bc'),
));
@@ -470,16 +473,28 @@ class API extends \Piwik\Plugin\API
* @deprecated
* @internal
*/
- public function getMetrics($idSite, $period, $date, $segment = false, $idGoal = false, $columns = array())
+ public function getMetrics($idSite, $period, $date, $segment = false, $idGoal = false, $columns = array(), $showAllGoalSpecificMetrics = false)
{
Piwik::checkUserHasViewAccess($idSite);
$archive = Archive::build($idSite, $period, $date, $segment);
+ $showAllGoalSpecificMetrics = $showAllGoalSpecificMetrics && $idGoal === false;
+
// Mapping string idGoal to internal ID
$idGoal = self::convertSpecialGoalIds($idGoal);
$isEcommerceGoal = $idGoal === GoalManager::IDGOAL_ORDER || $idGoal === GoalManager::IDGOAL_CART;
$allMetrics = Goals::getGoalColumns($idGoal);
+
+ if ($showAllGoalSpecificMetrics) {
+ foreach ($this->getGoals($idSite) as $aGoal) {
+ foreach (Goals::getGoalColumns($aGoal['idgoal']) as $goalColumn) {
+ $allMetrics[] = Goals::makeGoalColumn($aGoal['idgoal'], $goalColumn);
+ }
+ }
+ $allMetrics[] = 'nb_visits';
+ }
+
$columnsToShow = Piwik::getArrayFromApiParameter($columns);
$requestedColumns = $columnsToShow;
@@ -493,10 +508,24 @@ class API extends \Piwik\Plugin\API
$requestedColumns = array_unique(array_merge($requestedColumns, $metricsToAdd));
}
+ if ($showAllGoalSpecificMetrics && !empty($requestedColumns)) {
+ foreach ($requestedColumns as $requestedColumn) {
+ if (strpos($requestedColumn, '_conversion_rate') !== false) {
+ $columnIdGoal = Goals::getGoalIdFromGoalColumn($requestedColumn);
+ if ($columnIdGoal) {
+ $goalConversionRate = new GoalConversionRate($idSite, $columnIdGoal);
+ $metricsToAdd = $goalConversionRate->getDependentMetrics();
+ $requestedColumns = array_unique(array_merge($requestedColumns, $metricsToAdd));
+ }
+ }
+ }
+ }
+
$report = ReportsProvider::factory('Goals', 'getMetrics');
$columnsToGet = $report->getMetricsRequiredForReport($allMetrics, $requestedColumns);
$inDbMetricNames = array_map(function ($name) use ($idGoal) {
+ $name = str_replace('goal_', '', $name);
return $name == 'nb_visits' ? $name : Archiver::getRecordName($name, $idGoal);
}, $columnsToGet);
$dataTable = $archive->getDataTableFromNumeric($inDbMetricNames);
@@ -521,6 +550,23 @@ class API extends \Piwik\Plugin\API
$table->setMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME, $extraProcessedMetrics);
});
}
+ if ($showAllGoalSpecificMetrics) {
+ $dataTable->filter(function (DataTable $table) use($idSite, &$allMetrics, $requestedColumns) {
+ $extraProcessedMetrics = $table->getMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME);
+ if (empty($extraProcessedMetrics)) {
+ $extraProcessedMetrics = array();
+ }
+ foreach ($this->getGoals($idSite) as $aGoal) {
+ $metric = new GoalConversionRate($idSite, $aGoal['idgoal']);
+ if (!empty($requestedColumns) && !in_array($metric->getName(), $requestedColumns)) {
+ continue;
+ }
+ $extraProcessedMetrics[] = $metric;
+ $allMetrics[] = $metric->getName();
+ }
+ $table->setMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME, $extraProcessedMetrics);
+ });
+ }
// remove temporary metrics that were not explicitly requested
if (empty($columnsToShow)) {
diff --git a/plugins/Goals/Columns/Metrics/GoalConversionRate.php b/plugins/Goals/Columns/Metrics/GoalConversionRate.php
new file mode 100644
index 0000000000..9fb476044a
--- /dev/null
+++ b/plugins/Goals/Columns/Metrics/GoalConversionRate.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Plugins\Goals\Columns\Metrics;
+
+use Piwik\DataTable\Row;
+use Piwik\Metrics\Formatter;
+use Piwik\Piwik;
+use Piwik\Plugins\Goals\Goals;
+use Piwik\Tracker\GoalManager;
+
+/**
+ * The conversion rate for a specific goal. Calculated as:
+ *
+ * goal's nb_conversions / nb_visits
+ *
+ * The goal's nb_conversions is calculated by the Goal archiver and nb_visits
+ * by the core archiving process.
+ */
+class GoalConversionRate extends GoalSpecificProcessedMetric
+{
+
+ public function getName()
+ {
+ return Goals::makeGoalColumn($this->idGoal, 'conversion_rate');
+ }
+
+ public function getTranslatedName()
+ {
+ return Piwik::translate('Goals_ConversionRate', $this->getGoalName());
+ }
+
+ public function getDocumentation()
+ {
+ return Piwik::translate('Goals_ColumnConversionRateDocumentation', $this->getGoalNameForDocs());
+ }
+
+ public function getDependentMetrics()
+ {
+ return array('nb_visits', Goals::makeGoalColumn($this->idGoal, 'nb_conversions'));
+ }
+
+ public function format($value, Formatter $formatter)
+ {
+ return $formatter->getPrettyPercentFromQuotient($value);
+ }
+
+ public function compute(Row $row)
+ {
+ $nbVisits = $this->getMetric($row, 'nb_visits');
+ $conversions = $this->getMetric($row, Goals::makeGoalColumn($this->idGoal, 'nb_conversions'));
+
+ return Piwik::getQuotientSafe($conversions, $nbVisits, GoalManager::REVENUE_PRECISION + 2);
+ }
+} \ No newline at end of file
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecific/AverageOrderRevenue.php b/plugins/Goals/Columns/Metrics/GoalSpecific/AverageOrderRevenue.php
index 845310e39c..b490332af7 100644
--- a/plugins/Goals/Columns/Metrics/GoalSpecific/AverageOrderRevenue.php
+++ b/plugins/Goals/Columns/Metrics/GoalSpecific/AverageOrderRevenue.php
@@ -14,6 +14,7 @@ use Piwik\Metrics;
use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecificProcessedMetric;
+use Piwik\Plugins\Goals\Goals;
use Piwik\Tracker\GoalManager;
/**
@@ -25,7 +26,7 @@ class AverageOrderRevenue extends GoalSpecificProcessedMetric
{
public function getName()
{
- return $this->getColumnPrefix() . '_avg_order_revenue';
+ return Goals::makeGoalColumn($this->idGoal, 'avg_order_revenue');
}
public function getTranslatedName()
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecific/ConversionRate.php b/plugins/Goals/Columns/Metrics/GoalSpecific/ConversionRate.php
index 2f355c2762..746811192e 100644
--- a/plugins/Goals/Columns/Metrics/GoalSpecific/ConversionRate.php
+++ b/plugins/Goals/Columns/Metrics/GoalSpecific/ConversionRate.php
@@ -12,6 +12,7 @@ use Piwik\Metrics;
use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecificProcessedMetric;
+use Piwik\Plugins\Goals\Goals;
use Piwik\Tracker\GoalManager;
/**
@@ -26,7 +27,7 @@ class ConversionRate extends GoalSpecificProcessedMetric
{
public function getName()
{
- return $this->getColumnPrefix() . '_conversion_rate';
+ return Goals::makeGoalColumn($this->idGoal, 'conversion_rate');
}
public function getTranslatedName()
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecific/Conversions.php b/plugins/Goals/Columns/Metrics/GoalSpecific/Conversions.php
index 0a15a94e39..fa6b6ccf2f 100644
--- a/plugins/Goals/Columns/Metrics/GoalSpecific/Conversions.php
+++ b/plugins/Goals/Columns/Metrics/GoalSpecific/Conversions.php
@@ -11,6 +11,7 @@ use Piwik\DataTable\Row;
use Piwik\Metrics;
use Piwik\Piwik;
use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecificProcessedMetric;
+use Piwik\Plugins\Goals\Goals;
/**
* The conversions for a specific goal. Returns the conversions for a single goal which
@@ -20,7 +21,7 @@ class Conversions extends GoalSpecificProcessedMetric
{
public function getName()
{
- return $this->getColumnPrefix() . '_nb_conversions';
+ return Goals::makeGoalColumn($this->idGoal, 'nb_conversions');
}
public function getTranslatedName()
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecific/ItemsCount.php b/plugins/Goals/Columns/Metrics/GoalSpecific/ItemsCount.php
index 49b8184742..05398fc0f4 100644
--- a/plugins/Goals/Columns/Metrics/GoalSpecific/ItemsCount.php
+++ b/plugins/Goals/Columns/Metrics/GoalSpecific/ItemsCount.php
@@ -11,6 +11,7 @@ use Piwik\DataTable\Row;
use Piwik\Metrics;
use Piwik\Piwik;
use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecificProcessedMetric;
+use Piwik\Plugins\Goals\Goals;
/**
* The number of ecommerce order items for conversions of a goal. Returns the 'items'
@@ -20,7 +21,7 @@ class ItemsCount extends GoalSpecificProcessedMetric
{
public function getName()
{
- return $this->getColumnPrefix() . '_items';
+ return Goals::makeGoalColumn($this->idGoal, 'items');
}
public function getTranslatedName()
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecific/Revenue.php b/plugins/Goals/Columns/Metrics/GoalSpecific/Revenue.php
index 27b5b9dad5..18e3de2254 100644
--- a/plugins/Goals/Columns/Metrics/GoalSpecific/Revenue.php
+++ b/plugins/Goals/Columns/Metrics/GoalSpecific/Revenue.php
@@ -14,6 +14,7 @@ use Piwik\Metrics;
use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecificProcessedMetric;
+use Piwik\Plugins\Goals\Goals;
/**
* Revenue for a specific goal.
@@ -22,7 +23,7 @@ class Revenue extends GoalSpecificProcessedMetric
{
public function getName()
{
- return $this->getColumnPrefix() . '_revenue';
+ return Goals::makeGoalColumn($this->idGoal, 'revenue');
}
public function getTranslatedName()
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecific/RevenuePerVisit.php b/plugins/Goals/Columns/Metrics/GoalSpecific/RevenuePerVisit.php
index a90c1058d6..1391f2a99f 100644
--- a/plugins/Goals/Columns/Metrics/GoalSpecific/RevenuePerVisit.php
+++ b/plugins/Goals/Columns/Metrics/GoalSpecific/RevenuePerVisit.php
@@ -14,6 +14,7 @@ use Piwik\Metrics;
use Piwik\Metrics\Formatter;
use Piwik\Piwik;
use Piwik\Plugins\Goals\Columns\Metrics\GoalSpecificProcessedMetric;
+use Piwik\Plugins\Goals\Goals;
use Piwik\Tracker\GoalManager;
/**
@@ -27,7 +28,7 @@ class RevenuePerVisit extends GoalSpecificProcessedMetric
{
public function getName()
{
- return $this->getColumnPrefix() . '_revenue_per_visit';
+ return Goals::makeGoalColumn($this->idGoal, 'revenue_per_visit');
}
public function getTranslatedName()
diff --git a/plugins/Goals/Columns/Metrics/GoalSpecificProcessedMetric.php b/plugins/Goals/Columns/Metrics/GoalSpecificProcessedMetric.php
index 849bd45e56..cdd36339da 100644
--- a/plugins/Goals/Columns/Metrics/GoalSpecificProcessedMetric.php
+++ b/plugins/Goals/Columns/Metrics/GoalSpecificProcessedMetric.php
@@ -47,11 +47,6 @@ abstract class GoalSpecificProcessedMetric extends ProcessedMetric
$this->idGoal = $idGoal;
}
- protected function getColumnPrefix()
- {
- return 'goal_' . $this->idGoal;
- }
-
protected function getGoalMetrics(Row $row)
{
$allGoalMetrics = $this->getMetric($row, 'goals');
diff --git a/plugins/Goals/Controller.php b/plugins/Goals/Controller.php
index 653a3e27f7..d24c42e7b2 100644
--- a/plugins/Goals/Controller.php
+++ b/plugins/Goals/Controller.php
@@ -172,10 +172,11 @@ class Controller extends \Piwik\Plugin\Controller
}
if (empty($idGoal)) {
- $idGoal = Common::getRequestVar('idGoal', false, 'string');
+ $idGoal = Common::getRequestVar('idGoal', '', 'string');
}
$view = $this->getLastUnitGraph($this->pluginName, __FUNCTION__, 'Goals.get');
$view->requestConfig->request_parameters_to_modify['idGoal'] = $idGoal;
+ $view->requestConfig->request_parameters_to_modify['showAllGoalSpecificMetrics'] = 1;
$nameToLabel = $this->goalColumnNameToLabel;
if ($idGoal == Piwik::LABEL_ID_GOAL_IS_ECOMMERCE_ORDER) {
@@ -188,26 +189,26 @@ class Controller extends \Piwik\Plugin\Controller
}
$selectableColumns = array('nb_conversions', 'conversion_rate', 'revenue');
+ $goalSelectableColumns = $selectableColumns;
if ($this->site->isEcommerceEnabled()) {
$selectableColumns[] = 'items';
$selectableColumns[] = 'avg_order_revenue';
}
foreach (array_merge($columns ? $columns : array(), $selectableColumns) as $columnName) {
- $columnTranslation = '';
- // find the right translation for this column, eg. find 'revenue' if column is Goal_1_revenue
- foreach ($nameToLabel as $metric => $metricTranslation) {
- if (strpos($columnName, $metric) !== false) {
- $columnTranslation = $this->translator->translate($metricTranslation);
- break;
- }
- }
+ $columnTranslation = $this->getColumnTranslation($nameToLabel, $columnName, $idGoal);
+ $view->config->addTranslation($columnName, $columnTranslation);
+ }
- if (!empty($idGoal) && isset($this->goals[$idGoal])) {
- $goalName = $this->goals[$idGoal]['name'];
- $columnTranslation = "$columnTranslation (" . $this->translator->translate('Goals_GoalX', "$goalName") . ")";
+ if ($idGoal === '') {
+ foreach ($this->goals as $aGoal) {
+ foreach ($goalSelectableColumns as $goalColumn) {
+ $goalMetricName = Goals::makeGoalColumn($aGoal['idgoal'], $goalColumn);
+ $selectableColumns[] = $goalMetricName;
+ $columnTranslation = $this->getColumnTranslation($nameToLabel, $goalColumn, $aGoal['idgoal']);
+ $view->config->addTranslation($goalMetricName, $columnTranslation);
+ }
}
- $view->config->translations[$columnName] = $columnTranslation;
}
if (!empty($columns)) {
@@ -224,6 +225,24 @@ class Controller extends \Piwik\Plugin\Controller
return $this->renderView($view);
}
+ private function getColumnTranslation($nameToLabel, $columnName, $idGoal)
+ {
+ $columnTranslation = '';
+ // find the right translation for this column, eg. find 'revenue' if column is Goal_1_revenue
+ foreach ($nameToLabel as $metric => $metricTranslation) {
+ if (strpos($columnName, $metric) !== false) {
+ $columnTranslation = $this->translator->translate($metricTranslation);
+ break;
+ }
+ }
+
+ if (!empty($idGoal) && isset($this->goals[$idGoal])) {
+ $goalName = $this->goals[$idGoal]['name'];
+ $columnTranslation = "$columnTranslation (" . $this->translator->translate('Goals_GoalX', "$goalName") . ")";
+ }
+ return $columnTranslation;
+ }
+
protected function getTopDimensions($idGoal)
{
$columnNbConversions = 'goal_' . $idGoal . '_nb_conversions';
diff --git a/plugins/Goals/Goals.php b/plugins/Goals/Goals.php
index 7ff05985f5..389e1f9b84 100644
--- a/plugins/Goals/Goals.php
+++ b/plugins/Goals/Goals.php
@@ -45,6 +45,19 @@ class Goals extends \Piwik\Plugin
return $dimensionsByGroup;
}
+ public static function getGoalIdFromGoalColumn($columnName)
+ {
+ if (strpos($columnName, 'goal_') === 0) {
+ $column = str_replace(array('goal_'), '', $columnName);
+ return (int) $column;
+ }
+ }
+
+ public static function makeGoalColumn($idGoal, $column)
+ {
+ return 'goal_'. (int)$idGoal . '_' . $column;
+ }
+
public static function getGoalColumns($idGoal)
{
$columns = array(
diff --git a/plugins/Goals/tests/System/TrackGoalsOneConversionPerVisitTest.php b/plugins/Goals/tests/System/TrackGoalsOneConversionPerVisitTest.php
index cf1a1dbf92..48263ad471 100644
--- a/plugins/Goals/tests/System/TrackGoalsOneConversionPerVisitTest.php
+++ b/plugins/Goals/tests/System/TrackGoalsOneConversionPerVisitTest.php
@@ -38,6 +38,23 @@ class TrackGoalsOneConversionPerVisitTest extends SystemTestCase
'idSite' => self::$fixture->idSite,
'date' => self::$fixture->dateTime,
'periods' => array('day'))),
+ array($apiToCall, array(
+ 'otherRequestParameters' => array(
+ 'showAllGoalSpecificMetrics' =>1
+ ),
+ 'testSuffix' => 'showAllGoalSpecificMetrics',
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day'))),
+ array($apiToCall, array(
+ 'otherRequestParameters' => array(
+ 'showAllGoalSpecificMetrics' =>1,
+ 'columns' => 'goal_1_conversion_rate'
+ ),
+ 'testSuffix' => 'showAllGoalSpecificMetrics_requestedColumns',
+ 'idSite' => self::$fixture->idSite,
+ 'date' => self::$fixture->dateTime,
+ 'periods' => array('day'))),
// test for https://github.com/piwik/piwik/issues/9194 requesting log_conversion with log_link_visit_action segment
array($apiToCall, array(
'idSite' => self::$fixture->idSite,
diff --git a/plugins/Goals/tests/System/expected/test_trackGoals_oneConversionPerVisitshowAllGoalSpecificMetrics__Goals.get_day.xml b/plugins/Goals/tests/System/expected/test_trackGoals_oneConversionPerVisitshowAllGoalSpecificMetrics__Goals.get_day.xml
new file mode 100644
index 0000000000..61d25f1d46
--- /dev/null
+++ b/plugins/Goals/tests/System/expected/test_trackGoals_oneConversionPerVisitshowAllGoalSpecificMetrics__Goals.get_day.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <nb_visits>3</nb_visits>
+ <nb_conversions>3</nb_conversions>
+ <nb_visits_converted>2</nb_visits_converted>
+ <revenue>1000</revenue>
+ <goal_1_nb_conversions>2</goal_1_nb_conversions>
+ <goal_1_nb_visits_converted>2</goal_1_nb_visits_converted>
+ <goal_1_revenue>1000</goal_1_revenue>
+ <goal_2_nb_conversions>1</goal_2_nb_conversions>
+ <goal_2_nb_visits_converted>1</goal_2_nb_visits_converted>
+ <goal_2_revenue>0</goal_2_revenue>
+ <goal_1_conversion_rate>66.67%</goal_1_conversion_rate>
+ <goal_2_conversion_rate>33.33%</goal_2_conversion_rate>
+ <conversion_rate>66.67%</conversion_rate>
+ <nb_visits_new_visit>3</nb_visits_new_visit>
+ <nb_conversions_new_visit>3</nb_conversions_new_visit>
+ <nb_visits_converted_new_visit>2</nb_visits_converted_new_visit>
+ <revenue_new_visit>1000</revenue_new_visit>
+ <goal_1_nb_conversions_new_visit>2</goal_1_nb_conversions_new_visit>
+ <goal_1_nb_visits_converted_new_visit>2</goal_1_nb_visits_converted_new_visit>
+ <goal_1_revenue_new_visit>1000</goal_1_revenue_new_visit>
+ <goal_2_nb_conversions_new_visit>1</goal_2_nb_conversions_new_visit>
+ <goal_2_nb_visits_converted_new_visit>1</goal_2_nb_visits_converted_new_visit>
+ <goal_2_revenue_new_visit>0</goal_2_revenue_new_visit>
+ <goal_1_conversion_rate_new_visit>66.67%</goal_1_conversion_rate_new_visit>
+ <goal_2_conversion_rate_new_visit>33.33%</goal_2_conversion_rate_new_visit>
+ <conversion_rate_new_visit>66.67%</conversion_rate_new_visit>
+ <nb_visits_returning_visit>0</nb_visits_returning_visit>
+ <nb_conversions_returning_visit>0</nb_conversions_returning_visit>
+ <nb_visits_converted_returning_visit>0</nb_visits_converted_returning_visit>
+ <revenue_returning_visit>0</revenue_returning_visit>
+ <goal_1_nb_conversions_returning_visit>0</goal_1_nb_conversions_returning_visit>
+ <goal_1_nb_visits_converted_returning_visit>0</goal_1_nb_visits_converted_returning_visit>
+ <goal_1_revenue_returning_visit>0</goal_1_revenue_returning_visit>
+ <goal_2_nb_conversions_returning_visit>0</goal_2_nb_conversions_returning_visit>
+ <goal_2_nb_visits_converted_returning_visit>0</goal_2_nb_visits_converted_returning_visit>
+ <goal_2_revenue_returning_visit>0</goal_2_revenue_returning_visit>
+ <goal_1_conversion_rate_returning_visit>0%</goal_1_conversion_rate_returning_visit>
+ <goal_2_conversion_rate_returning_visit>0%</goal_2_conversion_rate_returning_visit>
+ <conversion_rate_returning_visit>0%</conversion_rate_returning_visit>
+</result> \ No newline at end of file
diff --git a/plugins/Goals/tests/System/expected/test_trackGoals_oneConversionPerVisitshowAllGoalSpecificMetrics_requestedColumns__Goals.get_day.xml b/plugins/Goals/tests/System/expected/test_trackGoals_oneConversionPerVisitshowAllGoalSpecificMetrics_requestedColumns__Goals.get_day.xml
new file mode 100644
index 0000000000..a457e430c6
--- /dev/null
+++ b/plugins/Goals/tests/System/expected/test_trackGoals_oneConversionPerVisitshowAllGoalSpecificMetrics_requestedColumns__Goals.get_day.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<result>
+ <goal_1_conversion_rate>66.67%</goal_1_conversion_rate>
+ <goal_1_conversion_rate_new_visit>66.67%</goal_1_conversion_rate_new_visit>
+ <goal_1_conversion_rate_returning_visit>0%</goal_1_conversion_rate_returning_visit>
+</result> \ No newline at end of file