Index: googleanalytics.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.admin.inc,v
retrieving revision 1.23
diff -u -p -r1.23 googleanalytics.admin.inc
--- googleanalytics.admin.inc	1 Oct 2010 22:24:16 -0000	1.23
+++ googleanalytics.admin.inc	15 Oct 2010 21:34:55 -0000
@@ -59,14 +59,22 @@ function googleanalytics_admin_settings_
     '#type' => 'fieldset',
     '#title' => t('Roles'),
   );
+ 
+  $roles_vis_options = array(t('Add to the selected roles only.'), t('Add to every role except the selected ones.'));  
+  $form['tracking']['role_vis_settings']['googleanalytics_vis_roles'] = array(
+    '#type' => 'radios',
+    '#title' => t('Add tracking for specific roles'),
+    '#options' => $roles_vis_options,
+    '#default_value' => variable_get('googleanalytics_vis_roles', 0),
+  );
 
   $role_options = array_map('check_plain', user_roles());
   $form['tracking']['role_vis_settings']['googleanalytics_roles'] = array(
     '#type' => 'checkboxes',
-    '#title' => t('Add tracking for specific roles'),
+    '#title' => t('Roles'),
     '#default_value' => variable_get('googleanalytics_roles', array()),
     '#options' => $role_options,
-    '#description' => t('If none are selected, all users will be tracked. If a user has any of the roles checked, that user will be tracked.'),
+    '#description' => t('If none of the roles are selected, all users will be tracked. If a user has any of the checked roles, that user will be tracked (or excluded, depending on the setting above).«  »'),
   );
 
   // Page specific visibility configurations.
Index: googleanalytics.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.install,v
retrieving revision 1.21
diff -u -p -r1.21 googleanalytics.install
--- googleanalytics.install	9 Oct 2010 14:39:38 -0000	1.21
+++ googleanalytics.install	15 Oct 2010 21:34:55 -0000
@@ -7,6 +7,7 @@
  */
 
 function googleanalytics_install() {
+  variable_set('googleanalytics_vis_roles', 0);
   variable_set('googleanalytics_visibility', 0);
 
   // Remove tracking from all administrative pages, see http://drupal.org/node/34970.
@@ -45,6 +46,7 @@ function googleanalytics_uninstall() {
   variable_del('googleanalytics_js_scope');
   variable_del('googleanalytics_custom');
   variable_del('googleanalytics_roles');
+  variable_del('googleanalytics_vis_roles');
   variable_del('googleanalytics_visibility');
   variable_del('googleanalytics_pages');
   variable_del('googleanalytics_tracker_anonymizeip');
Index: googleanalytics.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.module,v
retrieving revision 1.64
diff -u -p -r1.64 googleanalytics.module
--- googleanalytics.module	9 Oct 2010 21:46:12 -0000	1.64
+++ googleanalytics.module	15 Oct 2010 21:34:56 -0000
@@ -393,22 +393,23 @@ function _googleanalytics_visibility_use
  */
 function _googleanalytics_visibility_roles($account) {
 
-  $enabled = FALSE;
+  $visibility = variable_get('googleanalytics_vis_roles', 0);
+  $enabled = $visibility;
   $roles = variable_get('googleanalytics_roles', array());
 
   if (array_sum($roles) > 0) {
-    // One or more roles are selected for tracking.
+    // One or more roles are selected.
     foreach (array_keys($account->roles) as $rid) {
-      // Is the current user a member of one role enabled for tracking?
+      // Is the current user a member of one of these roles?
       if (isset($roles[$rid]) && $rid == $roles[$rid]) {
-        // Current user is a member of a role that should be tracked.
-        $enabled = TRUE;
+        // Current user is a member of a role that should be tracked/excluded from tracking.
+        $enabled = !$visibility;
         break;
       }
     }
   }
   else {
-    // No role is selected for tracking, therefor all roles should be tracked.
+    // No role is selected for tracking, therefore all roles should be tracked.
     $enabled = TRUE;
   }
 
