We have piwik 2.10.0 installed and max value in this table for idvisit is 2160434211 .The issue is that every new visit is getting inserted but after first visit no action get captured into database but when we truncate piwik_log_visit then data getting captured normally .
Any idea please as we are losing high data volume and hits decreased from 5.5m to 2m .
The actual issue was in following file function “updateExistingVisit” :
$idVisit = (int) $this->visitorInfo[‘idvisit’];
In above line, PHP integer parsing is applied and when idvisit value is greater than 2,147,483,647 (PHP 32bit is installed), it got set to 2,147,483,647 , so after first visit, previous visit id not found and hence query commits zero record .
One solution is to remove parse i.e remove (int) and other is to upgrade PHP to higher and 64bit version.
@Saqib_Ali Piwik 2.10 is really too old, and has serious security issues, please upgrade as soon as possible to Matomo 3.3.0
Yes the integer values will be capped at about 2 billion if your system is 32Bit as noted in PHP Doc:
The size of an integer is platform-dependent, although a maximum value of about two billion is the usual value (that’s 32 bits signed). 64-bit platforms usually have a maximum value of about 9E18, except on Windows prior to PHP 7, where it was always 32 bit. PHP does not support unsigned integers. Integer size can be determined using the constant PHP_INT_SIZE, maximum value using the constant PHP_INT_MAX since PHP 5.0.5, and minimum value using the constant PHP_INT_MIN since PHP 7.0.0.
Yes I have tested both , by removing parsing code i.e. (int) from the particulate line and by upgrading PHP to 64bit(>7.0) on IIS and upgrading PHP looks to me the right option as I do not have to find in code other places where parsing is applied.
Yes we have plans to upgrade to Matomo and above fix worked fine for Piwik 2.10 .