You are here

function ga_stats_ga_metrics in Google Analytics Statistics 7.x

Same name and namespace in other branches
  1. 7.2 ga_stats.module \ga_stats_ga_metrics()
  2. 7 ga_stats.module \ga_stats_ga_metrics()
4 calls to ga_stats_ga_metrics()
ga_stats_admin_settings in ./ga_stats.module
ga_stats_get_data in ./ga_stats.module
pull data from a source
ga_stats_update_counts in ./ga_stats.module
ga_stats_views_data in ./ga_stats.views.inc
Implementation of hook_views_data

File

inc/ga.inc, line 48

Code

function ga_stats_ga_metrics($all = false) {
  $metrics = array(
    'pageviews' => 'Page Views',
    'uniquePageviews' => 'Unique Page Views',
    'avgTimeOnPage' => 'Average Time on Page',
    'entrances' => 'Entrance Page',
  );
  if (!$all) {
    $enabled = variable_get('ga_stats_enabled_metrics', array(
      'pageviews',
    ));
    foreach ($metrics as $k => $v) {
      if (!$enabled[$k]) {
        unset($metrics[$k]);
      }
    }
  }
  return $metrics;
}