You are here

function google_analytics_token_info in Google Analytics 8.2

Same name and namespace in other branches
  1. 8.3 google_analytics.tokens.inc \google_analytics_token_info()
  2. 4.x google_analytics.tokens.inc \google_analytics_token_info()

Implements hook_token_info().

File

./google_analytics.tokens.inc, line 14
Builds placeholder replacement tokens for user-related data.

Code

function google_analytics_token_info() {
  $user['role-names'] = [
    'name' => t('User role names'),
    'description' => t('The role names the user account is a member of as comma separated list.'),
    'needs-data' => 'user',
  ];
  $user['role-ids'] = [
    'name' => t('User role ids'),
    'description' => t('The role ids the user account is a member of as comma separated list.'),
    'needs-data' => 'user',
  ];
  return [
    'tokens' => [
      'user' => $user,
    ],
  ];
}