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:
authorBeezyT <timo@ezdesign.de>2012-09-27 14:03:47 +0400
committerBeezyT <timo@ezdesign.de>2012-09-27 14:03:47 +0400
commit49790ad7ef1a31d77793c64196881f1d50ad2952 (patch)
treeb23d8b44e97eddee8ec17311b6ac9f995aaf12f5 /plugins/Transitions
parent221ccbc93e0ea26e2b1ba052dd74261e720b5897 (diff)
refs #3332 Transitions: the actions blob report is not used anymore - improved performance, consistency problems are gone, bounces are not available anymore
git-svn-id: http://dev.piwik.org/svn/trunk@7072 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/Transitions')
-rw-r--r--plugins/Transitions/API.php74
-rw-r--r--plugins/Transitions/Transitions.php1
-rw-r--r--plugins/Transitions/templates/transitions.js33
-rw-r--r--plugins/Transitions/templates/transitions.tpl6
4 files changed, 14 insertions, 100 deletions
diff --git a/plugins/Transitions/API.php b/plugins/Transitions/API.php
index 8db9d3bccb..ae91d82ec0 100644
--- a/plugins/Transitions/API.php
+++ b/plugins/Transitions/API.php
@@ -42,7 +42,6 @@ class Piwik_Transitions_API
'generalText' => '',
);
- $this->addMainPageMetricsToReport($report, $pageUrl, $idSite, $period, $date, $segment);
$this->addLiveTransitionsDataToReport($report, $pageUrl, $idSite, $period, $date, $segment, $limitBeforeGrouping);
// replace column names in the data tables
@@ -74,60 +73,6 @@ class Piwik_Transitions_API
}
/**
- * Add the main metrics (pageviews, exits, bounces) to the full report.
- * Data is loaded from Actions.getPageUrls using the label filter.
- */
- private function addMainPageMetricsToReport(&$report, $pageUrl, $idSite, $period, $date, $segment)
- {
- Piwik_Actions_ArchivingHelper::reloadConfig();
- $label = Piwik_Actions_ArchivingHelper::getActionExplodedNames($pageUrl, Piwik_Tracker_Action::TYPE_ACTION_URL);
- if (count($label) == 1)
- {
- $label = $label[0];
- }
- else
- {
- $label = array_map('urlencode', $label);
- $label = implode('>', $label);
- }
-
- $parameters = array(
- 'method' => 'Actions.getPageUrls',
- 'idSite' => $idSite,
- 'period' => $period,
- 'date' => $date,
- 'label' => $label,
- 'format' => 'original',
- 'serialize' => '0',
- 'expanded' => '0'
- );
- if (!empty($segment))
- {
- $parameters['segment'] = $segment;
- }
-
- $url = Piwik_Url::getQueryStringFromParameters($parameters);
- $request = new Piwik_API_Request($url);
- try
- {
- /** @var $dataTable Piwik_DataTable */
- $dataTable = $request->process();
- }
- catch(Exception $e)
- {
- throw new Exception("Actions.getPageUrls returned an error: ".$e->getMessage()."\n");
- }
-
- if ($dataTable->getRowsCount() > 0 && ($row = $dataTable->getFirstRow()) !== false)
- {
- $report['pageMetrics'] = array(
- 'exits' => intval($row->getColumn('exit_nb_visits')),
- 'bounces' => intval($row->getColumn('entry_bounce_count'))
- );
- }
- }
-
- /**
* Add transitions data to the report.
* Fake ArchiveProcessing to do the queries live.
*/
@@ -196,6 +141,11 @@ class Piwik_Transitions_API
}
}
+ // derive the number of exits from the other metrics
+ $report['pageMetrics']['exits'] = $report['pageMetrics']['pageviews']
+ - $transitionsArchiving->getTotalTransitionsToFollowingActions()
+ - $report['pageMetrics']['loops'];
+
// if there's no data for referrers, Piwik_API_ResponseBuilder::handleMultiDimensionalArray
// does not detect the multi dimensional array and the data is rendered differently, which
// causes an exception.
@@ -207,20 +157,6 @@ class Piwik_Transitions_API
'visits' => 0
);
}
-
- // sanitize values taken from the actions report in addMainPageMetricsToReport().
- // in some cases (e.g. URLs in DB with hash, actions report without hash), multiple
- // idactions get mapped to one row in the actions report. in this case, the numbers
- // are higher. we compensate for that here.
- if (isset($report['pageMetrics']['exits'])) {
- $followingActions = $transitionsArchiving->getTotalTransitionsToFollowingActions();
- $report['pageMetrics']['exits'] = min($report['pageMetrics']['exits'],
- $report['pageMetrics']['pageviews'] - $followingActions);
- $report['pageMetrics']['bounces'] = min($report['pageMetrics']['bounces'],
- $report['pageMetrics']['exits']);
- $report['pageMetrics']['bounces'] = min($report['pageMetrics']['bounces'],
- $report['pageMetrics']['entries']);
- }
}
private function getReferrerLabel($referrerId) {
diff --git a/plugins/Transitions/Transitions.php b/plugins/Transitions/Transitions.php
index a64c443588..8e1ceec496 100644
--- a/plugins/Transitions/Transitions.php
+++ b/plugins/Transitions/Transitions.php
@@ -17,6 +17,7 @@ class Piwik_Transitions extends Piwik_Plugin
{
private $limitBeforeGrouping = 5;
+ private $totalTransitionsToFollowingActions = 0;
public function getInformation()
{
diff --git a/plugins/Transitions/templates/transitions.js b/plugins/Transitions/templates/transitions.js
index 7f181c197e..94ae29a1f7 100644
--- a/plugins/Transitions/templates/transitions.js
+++ b/plugins/Transitions/templates/transitions.js
@@ -201,26 +201,16 @@ Piwik_Transitions.prototype.renderCenterBox = function() {
var el = box.find('.Transitions_' + cssClass);
Piwik_Transitions_Util.replacePlaceholderInHtml(el, self.model[modelProperty]);
- if (self.model[modelProperty] === null) {
- // bounces and exits are null if the url was not found in the actions report.
- // this happens when the report has been truncated.
- if (modelProperty == 'exits') {
- el.parent().hide();
- } else {
- el.hide();
- }
- } else if (self.model[modelProperty] == 0) {
+ if (self.model[modelProperty] == 0) {
el.addClass('Transitions_Value0');
} else {
self.addTooltipShowingPercentageOfAllPageviews(el, modelProperty);
var groupName = cssClass.charAt(0).toLowerCase() + cssClass.substr(1);
- if (highlightCurveOnSide !== false) {
- el.hover(function() {
- self.highlightGroup(groupName, highlightCurveOnSide);
- }, function() {
- self.unHighlightGroup(groupName, highlightCurveOnSide);
- });
- }
+ el.hover(function() {
+ self.highlightGroup(groupName, highlightCurveOnSide);
+ }, function() {
+ self.unHighlightGroup(groupName, highlightCurveOnSide);
+ });
if (groupCanBeExpanded) {
el.click(function() {
self.openGroup(highlightCurveOnSide, groupName);
@@ -239,7 +229,6 @@ Piwik_Transitions.prototype.renderCenterBox = function() {
showMetric('Outlinks', 'outlinksNbTransitions', 'right', true);
showMetric('Downloads', 'downloadsNbTransitions', 'right', true);
showMetric('Exits', 'exits', 'right', false);
- showMetric('Bounces', 'bounces', false, false);
box.find('.Transitions_CenterBoxMetrics').show();
};
@@ -1007,7 +996,6 @@ Piwik_Transitions_Model.prototype.loadData = function(link, callback) {
this.pageviews = 0;
this.exits = 0;
- this.bounces = 0;
this.loops = 0;
this.directEntries = 0;
@@ -1062,14 +1050,7 @@ Piwik_Transitions_Model.prototype.loadData = function(link, callback) {
// load page metrics
self.pageviews = report.pageMetrics.pageviews;
self.loops = report.pageMetrics.loops;
-
- if (typeof report.pageMetrics.exits == 'undefined') {
- self.exits = null;
- self.bounces = null;
- } else {
- self.exits = report.pageMetrics.exits;
- self.bounces = report.pageMetrics.bounces;
- }
+ self.exits = report.pageMetrics.exits;
// load referrers: split direct entries and others
for (var i = 0; i < report.referrers.length; i++) {
diff --git a/plugins/Transitions/templates/transitions.tpl b/plugins/Transitions/templates/transitions.tpl
index b15b799490..119028ae9e 100644
--- a/plugins/Transitions/templates/transitions.tpl
+++ b/plugins/Transitions/templates/transitions.tpl
@@ -19,11 +19,7 @@
<p class="Transitions_FollowingPages">{$translations.toFollowingPagesInline|translate}</p>
<p class="Transitions_Downloads">{$translations.downloadsInline|translate}</p>
<p class="Transitions_Outlinks">{$translations.outlinksInline|translate}</p>
- <p>
- <span class="Transitions_Exits">{$translations.exitsInline|translate}</span>,
- {'Transitions_Including'|translate}<br />
- <span class="Transitions_Bounces">{$translations.bouncesInline|translate}</span>
- </p>
+ <p class="Transitions_Exits">{$translations.exitsInline|translate}</p>
</div>
</div>
</div>