public static factory ( |
||
$request | ||
return |
public static function factory(Request $request)
{
/** @var Action[] $actions */
$actions = self::getAllActions($request);
foreach ($actions as $actionType) {
if (empty($action)) {
$action = $actionType;
continue;
}
$posPrevious = self::getPriority($action);
$posCurrent = self::getPriority($actionType);
if ($posCurrent > $posPrevious) {
$action = $actionType;
}
}
if (!empty($action)) {
return $action;
}
return new ActionPageview($request);
}
public function processRequestParams(VisitProperties $visitProperties, Request $request) { // normal page view, potentially triggering a URL matching goal $action = Action::factory($request); $action->writeDebugInfo(); $request->setMetadata('Actions', 'action', $action); // save the exit actions of the last action in this visit as the referrer actions for the action being tracked. // when the visit is updated, these columns will be changed, so we have to do this before recordLogs $request->setMetadata('Actions', 'idReferrerActionUrl', $visitProperties->getProperty('visit_exit_idaction_url')); $request->setMetadata('Actions', 'idReferrerActionName', $visitProperties->getProperty('visit_exit_idaction_name')); }