diff options
author | Matthieu Aubry <matt@piwik.org> | 2016-04-19 03:18:17 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2016-04-19 03:18:17 +0300 |
commit | 823a06ac0d22ccbf14b0b5934707f0c00a6e0eec (patch) | |
tree | aae1c2a0535cc2c59a5da5d77c5bd7fc2b5d9371 /core | |
parent | 030922c1d9e6eea83472d5819e7b88a0454d4f2d (diff) |
Trigger a Goal conversion for "Event matching goals" even when an event is tracked without a URL (#10018)
* use idGoal parameter in system tests
* Trigger a Goal conversion for "Event matching goals" even when an event is tracked without a URL
* Test files for green build
* Add new expected test file
Diffstat (limited to 'core')
-rw-r--r-- | core/Tracker/GoalManager.php | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/Tracker/GoalManager.php b/core/Tracker/GoalManager.php index b7a63775b5..3e1312fef3 100644 --- a/core/Tracker/GoalManager.php +++ b/core/Tracker/GoalManager.php @@ -130,7 +130,7 @@ class GoalManager $convertedGoals = array(); foreach ($goals as $goal) { $convertedUrl = $this->detectGoalMatch($goal, $action); - if (!empty($convertedUrl)) { + if (!is_null($convertedUrl)) { $convertedGoals[] = array('url' => $convertedUrl) + $goal; } } @@ -143,7 +143,7 @@ class GoalManager * * @param array $goal * @param Action $action - * @return string|null + * @return if a goal is matched, a string of the Action URL is returned, or if no goal was matched it returns null */ public function detectGoalMatch($goal, Action $action) { @@ -165,26 +165,26 @@ class GoalManager switch ($attribute) { case 'title': // Matching on Page Title - $url = $action->getActionName(); + $actionToMatch = $action->getActionName(); break; case 'event_action': - $url = $action->getEventAction(); + $actionToMatch = $action->getEventAction(); break; case 'event_name': - $url = $action->getEventName(); + $actionToMatch = $action->getEventName(); break; case 'event_category': - $url = $action->getEventCategory(); + $actionToMatch = $action->getEventCategory(); break; // url, external_website, file, manually... default: - $url = $action->getActionUrlRaw(); + $actionToMatch = $action->getActionUrlRaw(); break; } $pattern_type = $goal['pattern_type']; - $match = $this->isUrlMatchingGoal($goal, $pattern_type, $url); + $match = $this->isUrlMatchingGoal($goal, $pattern_type, $actionToMatch); if (!$match) { return null; } |