diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-12-24 02:22:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-24 02:22:08 +0300 |
commit | c9ce54d30ef1abd915bf6c069d577e4052575bd3 (patch) | |
tree | 9ed0c8e13426e2ae19c5dca94bc2d92b16a29966 /core | |
parent | 1c2502b38aeeac68bce6fc411e683b2fd8e61a92 (diff) |
Force new visit after 10K actions (#17014)
* Force new visit after 10K actions
* add test
* wording
* fix ui test
Diffstat (limited to 'core')
-rw-r--r-- | core/Tracker/VisitorRecognizer.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/Tracker/VisitorRecognizer.php b/core/Tracker/VisitorRecognizer.php index 7b4efdd0c1..3c670d0050 100644 --- a/core/Tracker/VisitorRecognizer.php +++ b/core/Tracker/VisitorRecognizer.php @@ -104,7 +104,17 @@ class VisitorRecognizer $shouldMatchOneFieldOnly = $this->shouldLookupOneVisitorFieldOnly($isVisitorIdToLookup, $request); list($timeLookBack, $timeLookAhead) = $this->getWindowLookupThisVisit($request); + $maxActions = TrackerConfig::getConfigValue('create_new_visit_after_x_actions'); + $visitRow = $this->model->findVisitor($idSite, $configId, $idVisitor, $userId, $persistedVisitAttributes, $shouldMatchOneFieldOnly, $isVisitorIdToLookup, $timeLookBack, $timeLookAhead); + + if (!empty($maxActions) && $maxActions > 0 + && !empty($visitRow['visit_total_actions']) + && $maxActions <= $visitRow['visit_total_actions']) { + $this->visitRow = false; + return false; + } + $this->visitRow = $visitRow; if ($visitRow |