You are here

function hook_google_analytics_counter_request_alter in Google Analytics Counter 7.3

Alter $request array before retrieving data from Google.

Alter request query submitted to google and provide custom filters or parameters For more information on how to customize requests to Google Analytics:

Parameters

array $request: Array with request options.

See also

https://ga-dev-tools.appspot.com/query-explorer/

1 invocation of hook_google_analytics_counter_request_alter()
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.api.php, line 32
Hooks provided by the Google Analytics Counter module.

Code

function hook_google_analytics_counter_request_alter(&$request) {

  // e.g. Only get stats for records from 15th of February, 2014 onwards (instead of 2005, which is the default date)
  $request['start_date'] = strtotime('2014-02-15');

  // e.g. Grab only stats for URLs which start with /blog/
  $request['filters'] = "ga:pagePath=~^/blog/";
}