Index: googleanalytics.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.admin.inc,v
retrieving revision 1.13.2.9
diff -u -p -r1.13.2.9 googleanalytics.admin.inc
--- googleanalytics.admin.inc	1 Oct 2010 22:19:01 -0000	1.13.2.9
+++ googleanalytics.admin.inc	13 Oct 2010 21:05:09 -0000
@@ -50,6 +50,15 @@ function googleanalytics_admin_settings_
     '#title' => t('Role specific tracking settings'),
     '#collapsible' => TRUE,
   );
+  
+  $roles_vis_options = array(t('Add to the selected roles only.'), t('Add to every role except the selected ones.'));
+  
+  $form['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),
+  );
 
   $roles = user_roles();
   $role_options = array();
@@ -58,10 +67,10 @@ function googleanalytics_admin_settings_
   }
   $form['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('Add tracking only for the selected role(s). If none of the roles 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.13.2.7
diff -u -p -r1.13.2.7 googleanalytics.install
--- googleanalytics.install	6 Oct 2010 22:11:09 -0000	1.13.2.7
+++ googleanalytics.install	13 Oct 2010 21:05:09 -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.
@@ -36,6 +37,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.36.2.21
diff -u -p -r1.36.2.21 googleanalytics.module
--- googleanalytics.module	9 Oct 2010 14:20:00 -0000	1.36.2.21
+++ googleanalytics.module	13 Oct 2010 21:05:10 -0000
@@ -345,22 +345,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;
   }
 
