You are here

function google_analytics_counter_report_data in Google Analytics Counter 7.2

Same name and namespace in other branches
  1. 7.3 google_analytics_counter_data.inc \google_analytics_counter_report_data()

Request report data.

Parameters

$params: An associative array containing:

  • profile_id: required [default=variable_get('google_analytics_counter_profile_id')]
  • metrics: required.
  • dimensions: optional [default=none]
  • sort_metric: optional [default=none]
  • filters: optional [default=none]
  • segment: optional [default=none]
  • start_date: optional [default=GA release date]
  • end_date: optional [default=today]
  • start_index: optional [default=1]
  • max_results: optional [default=10,000]

$cache_options: An optional associative array containing:

  • cid: optional [default=md5 hash]
  • expire: optional [default=CACHE_TEMPORARY]
  • refresh: optional [default=FALSE]
1 call to google_analytics_counter_report_data()
google_analytics_counter_update_path_counts in ./google_analytics_counter_data.inc
Find how many distinct paths does Google Analytics have for this profile. This function is triggered by hook_cron().

File

./google_analytics_counter_data.inc, line 349
Parsing and writing the fetched data.

Code

function google_analytics_counter_report_data($params = array(), $cache_options = array()) {
  $params_defaults = array(
    'profile_id' => 'ga:' . variable_get('google_analytics_counter_profile_id', 0),
  );
  $params += $params_defaults;
  $GAFeed = google_analytics_counter_new_gafeed();
  $GAFeed
    ->queryReportFeed($params, $cache_options);
  return $GAFeed;
}