You are here

function hook_better_statistics_methods in Better Statistics 7

Declare additional Statistics API methods.

Return value

An array of JavaScript files keyed by method name. In the future, this hook may be used more extensively (and unified with server-side implementations, but for now, this is purely for Statistics JavaScript API implementations.

Related topics

1 function implements hook_better_statistics_methods()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

better_statistics_better_statistics_methods in ./better_statistics.statistics.inc
Implements hook_better_statistics_methods().
1 invocation of hook_better_statistics_methods()
_better_statistics_update_methods in ./better_statistics.admin.inc
Rebuilds the Better Statistics Methods variable based on entries provided by implementations of hook_better_statistics_methods(). This is kept here and run only occasionally because method additions are rare and do not need to be re-generated…

File

./better_statistics.api.php, line 210
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_better_statistics_methods() {

  // A hypothetical event tracking method.
  $methods['my_module_events'] = drupal_get_path('module', 'my_module') . '/js/events.js';

  // A hypothetical conversion tracking method.
  $methods['my_module_conversions'] = drupal_get_path('module', 'my_module') . '/conversions.js';
  return $methods;
}