Bug in VisitTime.getVisitInformationPerServerTime API method for current hour actions on extremely long sessions?

Hi.

I will try to explain a “bug” or something that don’t seems to me that would have currently the expected behaviour.

In the API method call VisitTime.getVisitInformationPerServerTime – index.php?module=API&method=VisitTime.getVisitInformationPerServerTime&format=XML&idSite=3&period=day&date=today&expanded=1&token_auth=xxx – in order to export actions data to some other internal system to make integrated reports we watch that the current hour period, in our case, have so much higher values than all of the previous periods. And this wasn’t expected.

Further investigation on this issue we found that some users have extremely large active sessions – in our case it varies from some hours to some weeks – and these sessions cumulative actions value appear in current hour as actions for this period. All of them! As the hour pass the system make some different query and these sessions actions are no longer taken because they remain currently active and are reported as the current period and so on until the session became ended.

In the log_visit table the date value on visit_last_action_time is always a valid current date never make the session expire and is true it is the same active session but the actions wasn’t made all in the current period and that is the part that in my assumption is wrong. And for that reason this extremely high value in the current hour.

When the current hour became the previous hour piwik will show the “correct-as-expected-evolution” value for actions. And the “wrong” value will be shown in the current hour period again plus the “right” values for “normal” sessions.

In the table below when 10h become the previous hour it will so a value similar to 40 000 and 11h became the current one with the high value for actions.

For example:

isits by Server Time
SERVER TIME VISITS UNIQUE VISITORS USERS ACTIONS ACTIONS PER VISIT AVG. TIME ON WEBSITE BOUNCE RATE
0h 4138 3853 - 12654 3.06 5 min 5s 57.56%
1h 2095 1884 - 6336 3.02 4 min 39s 58.47%
2h 1244 1060 - 3735 3 4 min 33s 63.83%
3h 903 730 - 2253 2.5 3 min 3s 69.55%
4h 754 593 - 1826 2.42 2 min 46s 70.29%
5h 869 702 - 1804 2.08 2 min 13s 73.3%
6h 1704 1536 - 3558 2.09 2 min 10s 69.42%
7h 3943 3741 - 9349 2.37 2 min 40s 60.13%
8h 8447 8028 - 24183 2.86 4 min 36s 49.28%
9h 14359 13397 - 42453 2.96 5 min 45s 49.01%
10h 11016 10763 - 128422 11.66 10

Similar query – with smaller human readable tune – of the one captured in MySQL for make the upper table:

select ‘10’ as current_hour ,count(log_visit.idvisit), sum(log_visit.visit_total_actions)
FROM log_visit AS log_visit
WHERE log_visit.visit_last_action_time >= '2014-11-10 10:00:00’
AND log_visit.visit_last_action_time <= '2014-11-10 10:59:59’
AND log_visit.idsite = '3’
AND log_visit.visit_entry_idaction_url >0

What do yout think? Is this a bug?

Thanks, Pedro

This problem still continues. I think this is happening because for the visitinfobyservertime piwik is trying to get the actions of all visits, where the last action has occurred in a given server time. For long sessions all the actions of the sessions are reported only in the last hour. This is wrong in my opinion

Yes it still happens as reported.
No update have changed ths behaviour.
No one have even respond to this so maybe no change is expected.

Pedro

Hi there,

if you think you have found a bug, please create a bug report, and make sure to include clear and simple instructions. See: The Core Team Workflow: DevelopInDepth - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3