getMetrics() public method

By default the given {@link $metrics} are used and their corresponding translations are looked up automatically. If a metric is not translated, you should add the default metric translation for this metric using the {@hook Metrics.getDefaultMetricTranslations} event. If you want to overwrite any default metric translation you should overwrite this method, call this parent method to get all default translations and overwrite any custom metric translations.
public getMetrics ( ) : array
return array
Ejemplo n.º 1
0
 public function getMetrics()
 {
     $metrics = parent::getMetrics();
     $metrics['avg_time_on_site'] = Piwik::translate('General_VisitDuration');
     $metrics['max_actions'] = Piwik::translate('General_ColumnMaxActions');
     return $metrics;
 }
Ejemplo n.º 2
0
 public function getMetrics()
 {
     $metrics = parent::getMetrics();
     $metrics['max_actions'] = Piwik::translate('General_ColumnMaxActions');
     return $metrics;
 }
 public function getMetrics()
 {
     $metrics = parent::getMetrics();
     if ($this->scopeOfDimension === CustomDimensions::SCOPE_ACTION) {
         $metrics['nb_visits'] = Piwik::translate('CustomDimensions_ColumnUniqueActions');
     }
     if (array_key_exists('nb_hits', $metrics)) {
         $metrics['nb_hits'] = Piwik::translate('General_ColumnNbActions');
     }
     return $metrics;
 }