Skip to content

Commit

Permalink
Fix visitors overview bounce_rate regression.
Browse files Browse the repository at this point in the history
  • Loading branch information
diosmosis committed Nov 26, 2014
1 parent 2baaff9 commit c07d730
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions plugins/VisitsSummary/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,13 @@ protected function setSparklinesAndNumbers($view)

$dataTableVisit = self::getVisitsSummary();
$dataRow = $dataTableVisit->getRowsCount() == 0 ? new Row() : $dataTableVisit->getFirstRow();

$view->nbUniqVisitors = (int)$dataRow->getColumn('nb_uniq_visitors');
$view->nbUsers = (int)$dataRow->getColumn('nb_users');
$nbVisits = (int)$dataRow->getColumn('nb_visits');
$view->nbVisits = $nbVisits;

$view->averageVisitDuration = $dataRow->getColumn('avg_time_on_site');
$nbBouncedVisits = $dataRow->getColumn('bounce_count');
$view->bounceRate = Piwik::getPercentageSafe($nbBouncedVisits, $nbVisits);
$view->bounceRate = $dataRow->getColumn('bounce_rate');
$view->maxActions = (int)$dataRow->getColumn('max_actions');
$view->nbActionsPerVisit = $dataRow->getColumn('nb_actions_per_visit');

Expand Down
2 changes: 1 addition & 1 deletion plugins/VisitsSummary/templates/_sparklines.twig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</div>
<div class="sparkline">
{{ sparkline(urlSparklineBounceRate)|raw }}
{{ 'VisitsSummary_NbVisitsBounced'|translate("<strong>"~bounceRate~"%</strong>")|raw }}
{{ 'VisitsSummary_NbVisitsBounced'|translate("<strong>"~bounceRate~"</strong>")|raw }}
</div>
<div class="sparkline">
{{ sparkline(urlSparklineActionsPerVisit)|raw }}
Expand Down

0 comments on commit c07d730

Please sign in to comment.