Visit.php function getTimeSpentReferrerAction()


#1

Why does this function set $timeSpent to 0 if it is greater than visit_standard_lenght? If $timeSpent is greater than visit_standard_lenght, wouldn’t it be better to set the $timeSpent to visit_standard_length?
for example:
If($timeSpent > Config::getInstance()->Tracker[‘visit_standard_length’]){
$timeSpent = Config::getInstance()->Tracker[‘visit_standard_length’];
}

This function was pulled from visit.php
protected function getTimeSpentReferrerAction()
{
$timeSpent = $this->request->getCurrentTimestamp() - $this->visitorInfo[‘visit_last_action_time’];
if ($timeSpent < 0
|| $timeSpent > Config::getInstance()->Tracker[‘visit_standard_length’]
) {
$timeSpent = 0;
}
return $timeSpent;
}


(Matthieu Aubry) #2

Thanks for suggestion, i’ve made the change in: Make change suggested in forum: set long time on page when applicable. · matomo-org/matomo@6802709 · GitHub