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:
authorMatthieu Aubry <matt@piwik.org>2015-02-19 05:11:45 +0300
committerMatthieu Aubry <matt@piwik.org>2015-02-19 05:11:45 +0300
commit457583620818968321529e723ec1db37ec4c88e4 (patch)
treed4787529102d6f499e34a3213015895111396944 /core/DataAccess/LogAggregator.php
parentfac99a87faf29c1bff68abc0748e8091919687b7 (diff)
parent67c58eeaf5e60b59ffc98d29cc5cc2dd4a25ffd3 (diff)
Merge pull request #7244 from piwik/unique_visitors_metasites
Correctly process unique visitors across websites in MetaSite
Diffstat (limited to 'core/DataAccess/LogAggregator.php')
-rw-r--r--core/DataAccess/LogAggregator.php27
1 files changed, 17 insertions, 10 deletions
diff --git a/core/DataAccess/LogAggregator.php b/core/DataAccess/LogAggregator.php
index 83946b1f6f..8b8d5175ff 100644
--- a/core/DataAccess/LogAggregator.php
+++ b/core/DataAccess/LogAggregator.php
@@ -158,14 +158,15 @@ class LogAggregator
protected function getVisitsMetricFields()
{
return array(
- Metrics::INDEX_NB_UNIQ_VISITORS => "count(distinct " . self::LOG_VISIT_TABLE . ".idvisitor)",
- Metrics::INDEX_NB_VISITS => "count(*)",
- Metrics::INDEX_NB_ACTIONS => "sum(" . self::LOG_VISIT_TABLE . ".visit_total_actions)",
- Metrics::INDEX_MAX_ACTIONS => "max(" . self::LOG_VISIT_TABLE . ".visit_total_actions)",
- Metrics::INDEX_SUM_VISIT_LENGTH => "sum(" . self::LOG_VISIT_TABLE . ".visit_total_time)",
- Metrics::INDEX_BOUNCE_COUNT => "sum(case " . self::LOG_VISIT_TABLE . ".visit_total_actions when 1 then 1 when 0 then 1 else 0 end)",
- Metrics::INDEX_NB_VISITS_CONVERTED => "sum(case " . self::LOG_VISIT_TABLE . ".visit_goal_converted when 1 then 1 else 0 end)",
- Metrics::INDEX_NB_USERS => "count(distinct " . self::LOG_VISIT_TABLE . ".user_id)",
+ Metrics::INDEX_NB_UNIQ_VISITORS => "count(distinct " . self::LOG_VISIT_TABLE . ".idvisitor)",
+ Metrics::INDEX_NB_UNIQ_FINGERPRINTS => "count(distinct " . self::LOG_VISIT_TABLE . ".config_id)",
+ Metrics::INDEX_NB_VISITS => "count(*)",
+ Metrics::INDEX_NB_ACTIONS => "sum(" . self::LOG_VISIT_TABLE . ".visit_total_actions)",
+ Metrics::INDEX_MAX_ACTIONS => "max(" . self::LOG_VISIT_TABLE . ".visit_total_actions)",
+ Metrics::INDEX_SUM_VISIT_LENGTH => "sum(" . self::LOG_VISIT_TABLE . ".visit_total_time)",
+ Metrics::INDEX_BOUNCE_COUNT => "sum(case " . self::LOG_VISIT_TABLE . ".visit_total_actions when 1 then 1 when 0 then 1 else 0 end)",
+ Metrics::INDEX_NB_VISITS_CONVERTED => "sum(case " . self::LOG_VISIT_TABLE . ".visit_goal_converted when 1 then 1 else 0 end)",
+ Metrics::INDEX_NB_USERS => "count(distinct " . self::LOG_VISIT_TABLE . ".user_id)",
);
}
@@ -445,8 +446,14 @@ class LogAggregator
protected function isMetricRequested($metricId, $metricsRequested)
{
- return $metricsRequested === false
- || in_array($metricId, $metricsRequested);
+ // do not process INDEX_NB_UNIQ_FINGERPRINTS unless specifically asked for
+ if($metricsRequested === false) {
+ if($metricId == Metrics::INDEX_NB_UNIQ_FINGERPRINTS) {
+ return false;
+ }
+ return true;
+ }
+ return in_array($metricId, $metricsRequested);
}
protected function getWhereStatement($tableName, $datetimeField, $extraWhere = false)