You are here

function googleanalytics_search_get_keys in Google Analytics 7

Same name and namespace in other branches
  1. 7.2 googleanalytics.module \googleanalytics_search_get_keys()

Helper function for grabbing search keys. Function is missing in D7.

http://api.drupal.org/api/function/search_get_keys/6

1 call to googleanalytics_search_get_keys()
googleanalytics_page_alter in ./googleanalytics.module
Implements hook_page_alter() to insert JavaScript to the appropriate scope/region of the page.

File

./googleanalytics.module, line 447
Drupal Module: Google Analytics

Code

function googleanalytics_search_get_keys() {
  static $return;
  if (!isset($return)) {

    // Extract keys as remainder of path
    // Note: support old GET format of searches for existing links.
    $path = explode('/', $_GET['q'], 3);
    $keys = empty($_REQUEST['keys']) ? '' : $_REQUEST['keys'];
    $return = count($path) == 3 ? $path[2] : $keys;
  }
  return $return;
}