diff options
author | diosmosis <benaka@piwik.pro> | 2014-12-13 02:43:16 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-12-13 02:43:16 +0300 |
commit | 09a15c217316139dbf07b5b428cc6f85bcc9ae81 (patch) | |
tree | 84c232060c27bdb25c76a190f1c1d8d7a9e5300d /core/Plugin/Dimension | |
parent | a6cb3c87cd55ab2278a0eeb82f3da3d432e46223 (diff) |
Applying review changes: remove tracker_ prefix from config names, move shouldForceNewVisit to VisitDimension and simplify triggerPredicateHookOnDimensions.
Diffstat (limited to 'core/Plugin/Dimension')
-rw-r--r-- | core/Plugin/Dimension/VisitDimension.php | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/Plugin/Dimension/VisitDimension.php b/core/Plugin/Dimension/VisitDimension.php index 09a58554c0..b9aa3a9b2a 100644 --- a/core/Plugin/Dimension/VisitDimension.php +++ b/core/Plugin/Dimension/VisitDimension.php @@ -270,6 +270,25 @@ abstract class VisitDimension extends Dimension } /** + * This hook is executed by the tracker when determining if an action is the start of a new visit + * or part of an existing one. Derived classes can use it to force new visits based on dimension + * data. + * + * For example, the Campaign dimension in the Referrers plugin will force a new visit if the + * campaign information for the current action is different from the last. + * + * @param Request $request The current tracker request information. + * @param Visitor $visitor The information for the currently recognized visitor. + * @param Action|null $action The current action information (if any). + * @return bool Return true to force a visit, false if otherwise. + * @api + */ + public function shouldForceNewVisit(Request $request, Visitor $visitor, Action $action = null) + { + return false; + } + + /** * Get all visit dimensions that are defined by all activated plugins. * @return VisitDimension[] */ |