cactusman2 Posted August 8, 2010 Share Posted August 8, 2010 This problem concerns the stats module for online visitors integrated in Prestashop.When a visitor or a customer comes to my website he is then always considered as online even if is not in the website anymore.Basically everyone who visit my website will be considered as permanently online!Does anyone else has noticed this problem?Thanks ! Link to comment Share on other sites More sharing options...
rocky Posted August 8, 2010 Share Posted August 8, 2010 The "Visitors online" gets the number of connections that were started within 900 seconds (15 minutes) ago. See the getVisitorsOnline() function in modules/statshome/statshome.php: private function getVisitorsNow() { return Db::getInstance()->getValue(' SELECT COUNT(DISTINCT cp.`id_connections`) FROM `'._DB_PREFIX_.'connections_page` cp WHERE TIME_TO_SEC(TIMEDIFF(NOW(), cp.`time_start`)) < 900'); } If someone leaves the website one minute after arriving, they will be considered online for another 14 minutes, but not forever. You can decrease the number 900 to a smaller value if you want a more accurate view of exactly how many people are online at the moment. 1 Link to comment Share on other sites More sharing options...
cactusman2 Posted August 8, 2010 Author Share Posted August 8, 2010 Thanks for your answer.The strange thing is that the online customers are considered online for something like the last 24 hours and does not seems to clear anything after 900 seconds. I checked the files it's 900 as you said.I use the version 1.3.0.1 Link to comment Share on other sites More sharing options...
deamoon Posted September 5, 2010 Share Posted September 5, 2010 The "Visitors online" gets the number of connections that were started within 900 seconds (15 minutes) ago. See the getVisitorsOnline() function in modules/statshome/statshome.php: private function getVisitorsNow() { return Db::getInstance()->getValue(' SELECT COUNT(DISTINCT cp.`id_connections`) FROM `'._DB_PREFIX_.'connections_page` cp WHERE TIME_TO_SEC(TIMEDIFF(NOW(), cp.`time_start`)) < 900'); } If someone leaves the website one minute after arriving, they will be considered online for another 14 minutes, but not forever. You can decrease the number 900 to a smaller value if you want a more accurate view of exactly how many people are online at the moment. Thank you for this Link to comment Share on other sites More sharing options...
frosticek Posted March 9, 2011 Share Posted March 9, 2011 I have also problem with prestashop stats. First problem was, that "visitors for day" was much bigger number than is in G Analytics. Now, problem regrowth and prestashop is showing me hundreds of conection each day even if there is less than hundred of them. Link to comment Share on other sites More sharing options...
noesac Posted September 19, 2012 Share Posted September 19, 2012 The "Visitors online" gets the number of connections that were started within 900 seconds (15 minutes) ago. See the getVisitorsOnline() function in modules/statshome/statshome.php: private function getVisitorsNow() { return Db::getInstance()->getValue(' SELECT COUNT(DISTINCT cp.`id_connections`) FROM `'._DB_PREFIX_.'connections_page` cp WHERE TIME_TO_SEC(TIMEDIFF(NOW(), cp.`time_start`)) < 900'); } If someone leaves the website one minute after arriving, they will be considered online for another 14 minutes, but not forever. You can decrease the number 900 to a smaller value if you want a more accurate view of exactly how many people are online at the moment. Great thanks for this! I remember coming across this thread 2 years ago and bookmarked it in my head. It was hell trying to find it again...need to use real bookmarks next time. Link to comment Share on other sites More sharing options...
Recommended Posts