You are here

function ga_stats_ga_metrics in Google Analytics Statistics 7

Same name and namespace in other branches
  1. 7.2 ga_stats.module \ga_stats_ga_metrics()
  2. 7.x inc/ga.inc \ga_stats_ga_metrics()

List metrics with plugin names and google analytics names

Parameters

bool $all: Default is FALSE. If TRUE, will return all metrics including inactive ones.

Return value

array

4 calls to ga_stats_ga_metrics()
drush_ga_stats_generate_validate in ./ga_stats.drush.inc
Implements hook_drush_COMMAND_validate().
ga_stats_admin_settings in ./ga_stats.admin.inc
Callback for the GA Stats admin form.
ga_stats_collect_data in includes/ga.inc
Retrieve data for all configured metrics and time-frames.
ga_stats_views_data in ./ga_stats.views.inc
Implements hook_views_data().

File

./ga_stats.module, line 123

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' => TRUE,
    ));
    $metrics = array_intersect_key($metrics, array_filter($enabled));
  }
  return $metrics;
}