diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-06-23 07:02:26 +0400 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-06-23 07:02:26 +0400 |
commit | 999f46479294713104c962bfe7469e9b6e7a4bbf (patch) | |
tree | a22e349d850bc2f2946a85a3cab373c4b6dc1809 /plugins/Goals/Goals.php | |
parent | 462d78c290f19dd691d9634bf2b17d2adc4446af (diff) | |
parent | c0b42ff664a0846064df23db232ea774931ab7a3 (diff) |
0.6.3?
Diffstat (limited to 'plugins/Goals/Goals.php')
-rw-r--r-- | plugins/Goals/Goals.php | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/plugins/Goals/Goals.php b/plugins/Goals/Goals.php index 6ab468f09e..7e36b3a4d3 100644 --- a/plugins/Goals/Goals.php +++ b/plugins/Goals/Goals.php @@ -26,10 +26,11 @@ class Piwik_Goals extends Piwik_Plugin public function getInformation() { $info = array( - 'description' => Piwik_Translate('Goals_PluginDescription'), + 'name' => '(ALPHA) Goal Tracking', + 'description' => 'Create Goals and see reports about your goal conversions: evolution over time, revenue per visit, conversions per referer, per keyword, etc.', 'author' => 'Piwik', - 'author_homepage' => 'http://piwik.org/', - 'version' => Piwik_Version::VERSION, + 'homepage' => 'http://piwik.org/', + 'version' => '0.1', 'TrackerPlugin' => true, // this plugin must be loaded during the stats logging ); @@ -54,20 +55,11 @@ class Piwik_Goals extends Piwik_Plugin // add the 'goal' entry in the website array $array =& $notification->getNotificationObject(); - $array['goals'] = Piwik_Goals_API::getInstance()->getGoals($idsite); + $array['goals'] = Piwik_Goals_API::getGoals($idsite); } function addWidgets() { - Piwik_AddWidget('Goals_Goals', 'Goals_GoalsOverview', 'Goals', 'widgetGoalsOverview'); - $goals = Piwik_Tracker_GoalManager::getGoalDefinitions(Piwik_Common::getRequestVar('idSite')); - if(count($goals) > 0) - { - foreach($goals as $goal) - { - Piwik_AddWidget('Goals_Goals', $goal['name'], 'Goals', 'widgetGoalReport', array('idGoal' => $goal['idgoal'])); - } - } } function addMenus() @@ -75,14 +67,14 @@ class Piwik_Goals extends Piwik_Plugin $goals = Piwik_Tracker_GoalManager::getGoalDefinitions(Piwik_Common::getRequestVar('idSite')); if(count($goals)==0) { - Piwik_AddMenu('Goals_Goals', 'Goals_AddNewGoal', array('module' => 'Goals', 'action' => 'addNewGoal')); + Piwik_AddMenu('Goals', 'Add a new Goal', array('module' => 'Goals', 'action' => 'addNewGoal')); } else { - Piwik_AddMenu('Goals_Goals', 'Goals_Overview', array('module' => 'Goals', 'action' => 'index')); + Piwik_AddMenu('Goals', 'Overview', array('module' => 'Goals')); foreach($goals as $goal) { - Piwik_AddMenu('Goals_Goals', str_replace('%', '%%', $goal['name']), array('module' => 'Goals', 'action' => 'goalReport', 'idGoal' => $goal['idgoal'])); + Piwik_AddMenu('Goals', str_replace('%', '%%', $goal['name']), array('module' => 'Goals', 'action' => 'goalReport', 'idGoal' => $goal['idgoal'])); } } } @@ -96,7 +88,7 @@ class Piwik_Goals extends Piwik_Plugin static public function getRecordName($recordName, $idGoal = false, $visitorReturning = false) { $idGoalStr = $returningStr = ''; - if(!empty($idGoal)) + if($idGoal !== false) { $idGoalStr = $idGoal . "_"; } @@ -188,14 +180,14 @@ class Piwik_Goals extends Piwik_Plugin $metricName = Piwik_Archive::$mappingFromIdToNameGoal[$metricId]; $recordName = self::getRecordName($metricName, $idgoal, $visitor_returning); $archiveProcessing->insertNumericRecord($recordName, $value); -// echo $record . "<br />"; +// echo $record . "<br>"; } } } // Stats for all goals $totalAllGoals = array( - self::getRecordName('conversion_rate') => $this->getConversionRate($archiveProcessing->getNumberOfVisitsConverted(), $archiveProcessing), + self::getRecordName('conversion_rate') => round(100 * $archiveProcessing->getNumberOfVisitsConverted() / $archiveProcessing->getNumberOfVisits(), self::ROUNDING_PRECISION), self::getRecordName('nb_conversions') => $nb_conversions, self::getRecordName('revenue') => $revenue, ); |