--- orig.template.php	2009-01-24 12:18:04.000000000 -0500
+++ template.php	2009-01-24 12:17:35.000000000 -0500
@@ -2,11 +2,24 @@
 
 
 function fb_fbml_page($content, $show_blocks = TRUE) {
+  global $user;
+
   $output = phptemplate_page($content, $show_blocks);
   
   if (function_exists('fb_canvas_process')) {
     $output = fb_canvas_process($output);
   }
+
+  if (module_exists('googleanalytics')) {
+    $id = variable_get('googleanalytics_account', '');
+
+    // 1. Check if the GA account number has a value.
+    // 2. Check if we should track the currently active user's role.
+    if (!empty($id) && _googleanalytics_visibility_user($user)) {
+      $output .= ' <fb:google-analytics uacct="' . $id . '" />' ;
+    }
+  }
+
   return $output;
   
 }
@@ -204,4 +217,4 @@ function phptemplate_fieldset($element) 
   return $output;
 }
 
-?>
\ No newline at end of file
+?>
