diff --git a/core/Tracker/Settings.php b/core/Tracker/Settings.php index f58c01d6bae6c919002f0a99d26a47d0d602c4ff..36aeb91716164378336823234196e3fd401b433c 100644 --- a/core/Tracker/Settings.php +++ b/core/Tracker/Settings.php @@ -18,7 +18,8 @@ class Settings // TODO: merge w/ visitor recognizer or make it it's own service. const OS_BOT = 'BOT'; /** - * TODO + * If `true`, the config ID for a visitor will be the same no matter what site is being tracked. + * If `false, the config ID will be different. * * @var bool */ diff --git a/core/Tracker/VisitorRecognizer.php b/core/Tracker/VisitorRecognizer.php index 962e92a3ec8ad1226c59b4f66002907904cb3bf6..a76ad2c4005ac4df4671dbc442d4df26bab8887e 100644 --- a/core/Tracker/VisitorRecognizer.php +++ b/core/Tracker/VisitorRecognizer.php @@ -15,55 +15,52 @@ use Piwik\Plugins\CustomVariables\CustomVariables; use Piwik\Tracker\Visit\VisitProperties; /** - * TODO + * Tracker service that finds the last known visit for the visitor being tracked. */ class VisitorRecognizer { /** - * TODO + * Local variable cache for the getVisitFieldsPersist() method. * * @var array */ private $visitFieldsToSelect; /** - * TODO + * See http://piwik.org/faq/how-to/faq_175/. * * @var bool */ private $trustCookiesOnly; /** - * TODO + * Length of a visit in seconds. * * @var int */ private $visitStandardLength; /** - * TODO + * Number of seconds that have to pass after an action before a new action from the same visitor is + * considered a new visit. Defaults to $visitStandardLength. * * @var int */ private $lookBackNSecondsCustom; /** - * TODO + * Forces all requests to result in new visits. For debugging only. * * @var int */ private $trackerAlwaysNewVisitor; /** - * TODO - * * @var Model */ private $model; /** - * TODO - * * @var EventDispatcher */ private $eventDispatcher; @@ -80,15 +77,6 @@ class VisitorRecognizer $this->eventDispatcher = $eventDispatcher; } - /** - * This methods tries to see if the visitor has visited the website before. - * - * We have to split the visitor into one of the category - * - Known visitor - * - New visitor - * - * TODO: move docs to class docs - */ public function findKnownVisitor($configId, VisitProperties $visitProperties, Request $request) { $idSite = $request->getIdSite(); diff --git a/plugins/Heartbeat/Tracker/PingRequestProcessor.php b/plugins/Heartbeat/Tracker/PingRequestProcessor.php index 20144aa6f9b2000eb7612b132fa726bc3a0ced93..80e9759df851f99d631bef0c6e513ecab815212f 100644 --- a/plugins/Heartbeat/Tracker/PingRequestProcessor.php +++ b/plugins/Heartbeat/Tracker/PingRequestProcessor.php @@ -19,22 +19,14 @@ use Piwik\Tracker\Visit\VisitProperties; */ class PingRequestProcessor extends RequestProcessor { - public function processRequestParams(VisitProperties $visitProperties, Request $request) + public function afterRequestProcessed(VisitProperties $visitProperties, Request $request) { if ($this->isPingRequest($request)) { // on a ping request that is received before the standard visit length, we just update the visit time w/o adding a new action Common::printDebug("-> ping=1 request: we do not track a new action nor a new visit nor any goal."); - $visitProperties->setRequestMetadata('Actions', 'action', null); - } - } - - public function afterRequestProcessed(VisitProperties $visitProperties, Request $request) - { - if ($this->isPingRequest($request)) { $visitProperties->setRequestMetadata('Goals', 'someGoalsConverted', false); $visitProperties->setRequestMetadata('Goals', 'visitIsConverted', false); - // TODO: double check: can this be merged w/ setting action to null? // When a ping request is received more than 30 min after the last request/ping, // we choose not to create a new visit. diff --git a/tests/PHPUnit/Integration/Tracker/VisitTest.php b/tests/PHPUnit/Integration/Tracker/VisitTest.php index b89800e705aada83c6e619251dc97fa0bd7731ab..a9ff54f44c549092b67caf80b8f20e68f700652f 100644 --- a/tests/PHPUnit/Integration/Tracker/VisitTest.php +++ b/tests/PHPUnit/Integration/Tracker/VisitTest.php @@ -23,8 +23,6 @@ use Piwik\Tests\Framework\TestCase\IntegrationTestCase; /** * @group Core - * - * TODO: move isVisitNew tests to CoreHome plugin */ class VisitTest extends IntegrationTestCase {