protected function enrichWithConversions(&$data)
    {
        foreach ($data as &$values) {
            if (!isset($values[Metrics::INDEX_GOALS])) {
                continue;
            }
            // When per goal metrics are processed, general 'visits converted' is not meaningful because
            // it could differ from the sum of each goal conversions
            unset($values[Metrics::INDEX_NB_VISITS_CONVERTED]);
            $revenue = $conversions = 0;
            foreach ($values[Metrics::INDEX_GOALS] as $idgoal => $goalValues) {
                // Do not sum Cart revenue since it is a lost revenue
                if ($idgoal >= GoalManager::IDGOAL_ORDER) {
                    $revenue += $goalValues[Metrics::INDEX_GOAL_REVENUE];
                    $conversions += $goalValues[Metrics::INDEX_GOAL_NB_CONVERSIONS];
                }
            }
            $values[Metrics::INDEX_NB_CONVERSIONS] = $conversions;

            // 25.00 recorded as 25
            if (round($revenue) == $revenue) {
                $revenue = round($revenue);
            }
            $values[Metrics::INDEX_REVENUE] = $revenue;

            // if there are no "visit" column, we force one to prevent future complications
            // eg. This helps the setDefaultColumnsToDisplay() call
            if (!isset($values[Metrics::INDEX_NB_VISITS])) {
                $values[Metrics::INDEX_NB_VISITS] = 0;
            }
        }
    }