/** * Adds processed goal metrics to a table: * - global conversion rate, * - global revenue per visit. * Can also process per-goal metrics: * - conversion rate * - nb conversions * - revenue per visit * * @param Piwik_DataTable $table * @param bool $enable should be true (automatically set to true when filter_update_columns_when_show_all_goals is found in the API request) * @param bool $processOnlyIdGoal Defines what metrics to add (don't process metrics when you don't display them) * If self::GOALS_FULL_TABLE, all Goal metrics (and per goal metrics) will be processed * If self::GOALS_OVERVIEW, only the main goal metrics will be added * If an int > 0, then will process only metrics for this specific Goal * @return void */ public function __construct($table, $enable = true, $processOnlyIdGoal) { $this->processOnlyIdGoal = $processOnlyIdGoal; // Ensure that all rows with no visit but conversions will be displayed $this->deleteRowsWithNoVisit = false; parent::__construct($table); }
/** * Adds processed goal metrics to a table: * - global conversion rate, * - global revenue per visit. * Can also process per-goal metrics: * - conversion rate * - nb conversions * - revenue per visit * * @param Piwik_DataTable $table * @param bool $enable should be true (automatically set to true when filter_update_columns_when_show_all_goals is found in the API request) * @param string $processOnlyIdGoal Defines what metrics to add (don't process metrics when you don't display them) * If self::GOALS_FULL_TABLE, all Goal metrics (and per goal metrics) will be processed * If self::GOALS_OVERVIEW, only the main goal metrics will be added * If an int > 0, then will process only metrics for this specific Goal * @return void */ public function __construct($table, $enable = true, $processOnlyIdGoal) { $this->processOnlyIdGoal = $processOnlyIdGoal; $this->isEcommerce = $this->processOnlyIdGoal == Piwik_Archive::LABEL_ECOMMERCE_ORDER || $this->processOnlyIdGoal == Piwik_Archive::LABEL_ECOMMERCE_CART; parent::__construct($table); // Ensure that all rows with no visit but conversions will be displayed $this->deleteRowsWithNoVisit = false; }