You are here

function googleanalytics_token_values in Google Analytics 6.3

Same name and namespace in other branches
  1. 6.4 googleanalytics.module \googleanalytics_token_values()

Implementation of hook_token_values().

File

./googleanalytics.module, line 575
Drupal Module: GoogleAnalytics Adds the required Javascript to the bottom of all your Drupal pages to allow tracking by the Google Analytics statistics package.

Code

function googleanalytics_token_values($type, $object = NULL, $options = array()) {
  if ($type == 'user' && !empty($object->roles)) {
    $account = $object;

    // Basic user account information.
    $tokens['user-role-names'] = implode(',', $account->roles);
    $tokens['user-role-ids'] = implode(',', array_keys($account->roles));
    return $tokens;
  }
}