You are here

function hook_google_analytics_counter_query_alter in Google Analytics Counter 8.3

Same name and namespace in other branches
  1. 7.3 google_analytics_counter.api.php \hook_google_analytics_counter_query_alter()

Alter Select query before it gets executed.

Here you can customize the select query which writes into the proper storage table the number of pageviews for each node.

Parameters

SelectQuery $query: Query builder for SELECT statements.

File

./google_analytics_counter.api.php, line 17
Hooks provided by the Google Analytics Counter module.

Code

function hook_google_analytics_counter_query_alter(SelectQuery &$query) {

  // Example: Restrict node pageview storage to node type: blog.
  $query
    ->condition('type', 'blog', 'LIKE');
}