diff --git a/src/messenger/webim/libs/track.php b/src/messenger/webim/libs/track.php index 63d056eb..fb3ca394 100644 --- a/src/messenger/webim/libs/track.php +++ b/src/messenger/webim/libs/track.php @@ -49,12 +49,12 @@ function track_visitor_start($entry, $referer, $link) db_escape_string($visitor['name']), db_escape_string($entry), db_escape_string(track_build_details())), $link); + $id = db_insert_id($link); - if ($SESSION['visitorid']) { - track_visit_page($SESSION['visitorid'], $referer, $link); + if ($id) { + track_visit_page($id, $referer, $link); } - $id = db_insert_id($link); return $id ? $id : 0; }