### Eclipse Workspace Patch 1.0
#P drupal-contrib-6--1
Index: modules/google_analytics/googleanalytics.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.module,v
retrieving revision 1.16.2.8
diff -u -r1.16.2.8 googleanalytics.module
--- modules/google_analytics/googleanalytics.module	30 Dec 2007 02:28:08 -0000	1.16.2.8
+++ modules/google_analytics/googleanalytics.module	30 Dec 2007 10:58:25 -0000
@@ -217,15 +217,24 @@
  *   A decision on if the current user is being tracked by GAnalytics
  */
 function _googleanalytics_track($account) {
-  $track = TRUE;
+  // By default we don't track users.
+  $track = FALSE;
 
   foreach (array_keys($account->roles) as $role) {
-    if (!variable_get('googleanalytics_track_'. $role, FALSE)) {
-      $track = FALSE;
+    // Add the tracking code if user is member of one role that should be tracked.
+    if (variable_get('googleanalytics_track_'. $role, FALSE)) {
+      $track = TRUE;
     }
   }
 
-  if ($account->uid == 1 && !variable_get('googleanalytics_track__user1', FALSE)) {
+  // Special behavior for administrative user 1.
+  if ($account->uid == 1 && variable_get('googleanalytics_track__user1', FALSE)) {
+    // Enable tracking of user 1 if tracking for "authenticated user" is disabled.
+    $track = TRUE;
+  }
+  elseif ($account->uid == 1 && !variable_get('googleanalytics_track__user1', FALSE)) {
+    // User 1 is a member of "authenticated user". Disable user tracking
+    // if user 1 shouldn't, but "authenticated user" should be tracked.
     $track = FALSE;
   }
 
