You are here

google_analytics_counter.api.php in Google Analytics Counter 8.3

Same filename and directory in other branches
  1. 7.3 google_analytics_counter.api.php

Hooks provided by the Google Analytics Counter module.

File

google_analytics_counter.api.php
View source
<?php

/**
 * @file
 * Hooks provided by the Google Analytics Counter module.
 */

/**
 * 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.
 *
 * @param SelectQuery $query
 *   Query builder for SELECT statements.
 */
function hook_google_analytics_counter_query_alter(SelectQuery &$query) {

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

/**
 * Informs other modules about which nodes have been updated.
 *
 * @param array $updated_nids
 *   Associative array with the new pageview total keyed by the nid.
 */
function hook_google_analytics_counter_update(array $updated_nids) {
}

Functions

Namesort descending Description
hook_google_analytics_counter_query_alter Alter Select query before it gets executed.
hook_google_analytics_counter_update Informs other modules about which nodes have been updated.