You are here

function analytics_get_output in Analytics 7

1 call to analytics_get_output()
analytics_page_build in ./analytics.module
Implements hook_page_build().

File

./analytics.module, line 74

Code

function analytics_get_output(array $context = array()) {
  $results = array();
  $services = analytics_service_load_enabled();
  foreach ($services as $service) {
    try {
      if ($service
        ->canTrack($context) && ($output = $service
        ->getOutput($context))) {

        // Allow modules to alter the render array.
        drupal_alter('analytics_output', $output, $service);
        $results['analytics_' . $service
          ->getMachineName()] = $output;
      }
    } catch (Exception $e) {
      watchdog_exception('analytics', $e);
    }
  }
  return $results;
}