_googleanalytics_visibility_user
Drupal 7 _googleanalytics_visibility_user($account)
Tracking visibility check for an user object.
Parameters
$account: A user object containing an array of roles to check.
Return value
boolean A decision on if the current user is being tracked by Google Analytics.
3 calls to _googleanalytics_visibility_user()
File
- sites/
all/ modules/ google_analytics/ googleanalytics.module, line 466
Code
function _googleanalytics_visibility_user($account) {
$enabled = FALSE;
// Is current user a member of a role that should be tracked?
if (_googleanalytics_visibility_header($account) && _googleanalytics_visibility_roles($account)) {
// Use the user's block visibility setting, if necessary.
if (($custom = variable_get('googleanalytics_custom', 0)) != 0) {
if ($account->uid && isset($account->data['googleanalytics']['custom'])) {
$enabled = $account->data['googleanalytics']['custom'];
}
else {
$enabled = ($custom == 1);
}
}
else {
$enabled = TRUE;
}
}
return $enabled;
}

