Skip to content
Extraits de code Groupes Projets
Valider cfb2fc27 rédigé par benakamoorthi's avatar benakamoorthi
Parcourir les fichiers

Fixes #3274, added 'time on page' info to page tooltip in real time visitors...

Fixes #3274, added 'time on page' info to page tooltip in real time visitors widget and in visitor log.


git-svn-id: http://dev.piwik.org/svn/trunk@6686 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 83d0916c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -171,6 +171,7 @@ $translations = array(
'General_ColumnUniqueExits' => 'Unique exits',
'General_ColumnExitsDocumentation' => 'Number of visits that ended on this page.',
'General_ColumnAverageTimeOnPage' => 'Avg. time on page',
'General_TimeOnPage' => 'Time on page',
'General_ColumnAverageTimeOnPageDocumentation' => 'The average amount of time visitors spent on this page (only the page, not the entire website).',
'General_ColumnValuePerVisit' => 'Revenue per Visit',
'General_ColumnVisitsWithConversions' => 'Visits with Conversions',
......
......@@ -189,7 +189,8 @@ class Piwik_Live_API
log_action_title.name AS pageTitle,
log_action.idaction AS pageIdAction,
log_link_visit_action.idlink_va AS pageId,
log_link_visit_action.server_time as serverTimePretty
log_link_visit_action.server_time as serverTimePretty,
log_link_visit_action.time_spent_ref_action as timeSpentRef
$sqlCustomVariables
FROM " .Piwik_Common::prefixTable('log_link_visit_action')." AS log_link_visit_action
INNER JOIN " .Piwik_Common::prefixTable('log_action')." AS log_action
......@@ -200,7 +201,7 @@ class Piwik_Live_API
";
$actionDetails = Piwik_FetchAll($sql, array($idvisit));
foreach($actionDetails as &$actionDetail)
foreach($actionDetails as $actionIdx => &$actionDetail)
{
$customVariablesPage = array();
for($i = 1; $i <= Piwik_Tracker::MAX_CUSTOM_VARIABLES; $i++)
......@@ -220,6 +221,13 @@ class Piwik_Live_API
{
$actionDetail['customVariables'] = $customVariablesPage;
}
// set the time spent for this action (which is the timeSpentRef of the next action)
if (isset($actionDetails[$actionIdx + 1]))
{
$timeSpent = $actionDetails[$actionIdx + 1]['timeSpentRef'];
$actionDetail['timeSpent'] = Piwik::getPrettyTimeFromSeconds($timeSpent);
}
}
// If the visitor converted a goal, we shall select all Goals
......
......@@ -53,7 +53,7 @@
{php}$col++; if ($col>=9) { $col=0; }{/php}
<a href="{$action.url|escape:'html'}" target="_blank">
{if $action.type == 'action'}
<img src="plugins/Live/templates/images/file{php} echo $col; {/php}.png" title="{if !empty($action.pageTitle)}{$action.pageTitle}{/if} - {$action.serverTimePretty|escape:'html'}" />
<img src="plugins/Live/templates/images/file{php} echo $col; {/php}.png" title="{if !empty($action.pageTitle)}{$action.pageTitle}{/if} - {$action.serverTimePretty|escape:'html'}{if isset($action.timeSpent)} - {'General_TimeOnPage'|translate}: {$action.timeSpent}{/if}" />
{elseif $action.type == 'outlink' || $action.type == 'download'}
<img class='iconPadding' src="{$action.icon}" title="{$action.url|escape:'html'} - {$action.serverTimePretty|escape:'html'}" />
{else}
......@@ -69,4 +69,4 @@
</div>
</li>
{/foreach}
</ul>
\ No newline at end of file
</ul>
......@@ -167,7 +167,7 @@
{if !$javascriptVariablesToSet.filterEcommerce
|| $action.type == 'ecommerceOrder'
|| $action.type == 'ecommerceAbandonedCart'}
<li class="{if !empty($action.goalName)}goal{else}action{/if}" title="{$action.serverTimePretty|escape:'html'}{if !empty($action.url) && strlen(trim($action.url))} - {$action.url|escape:'html'}{/if} {if strlen(trim($customVariablesTooltip))} - {$customVariablesTooltip}{/if}">
<li class="{if !empty($action.goalName)}goal{else}action{/if}" title="{$action.serverTimePretty|escape:'html'}{if !empty($action.url) && strlen(trim($action.url))} - {$action.url|escape:'html'}{/if} {if strlen(trim($customVariablesTooltip))} - {$customVariablesTooltip}{/if}{if isset($action.timeSpent)} - {'General_TimeOnPage'|translate}: {$action.timeSpent}{/if}">
{if $action.type == 'ecommerceOrder' || $action.type == 'ecommerceAbandonedCart'}
{* Ecommerce Abandoned Cart / Ecommerce Order *}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter