? .svn
? translations/.svn
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	22 Oct 2010 15:00:25 -0000
@@ -322,3 +322,10 @@ function googleanalytics_update_7001() {
     return t('The default country in your regional settings is <em>not</em> Germany. The anonymizing of IP addresses setting has not been changed. Make sure your site settings comply with the local privacy rules.');
   }
 }
+
+/**
+ * Delete the variable for scope since it should be page_bottom, not header.
+ */
+function googleanalytics_update_7002() {
+  variable_del('googleanalytics_js_scope');
+}
Index: googleanalytics.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/google_analytics/googleanalytics.module,v
retrieving revision 1.65
diff -u -p -r1.65 googleanalytics.module
--- googleanalytics.module	20 Oct 2010 23:36:45 -0000	1.65
+++ googleanalytics.module	22 Oct 2010 15:00:25 -0000
@@ -71,18 +71,12 @@ function googleanalytics_page_alter(&$pa
   // 4. Ignore pages visibility filter for 404 or 403 status codes.
   if (!empty($id) && (_googleanalytics_visibility_pages() || in_array($status, $trackable_status_codes)) && _googleanalytics_visibility_user($user)) {
 
-    // We allow different scopes. Default to 'header' but allow user to override if they really need to.
-    $scope = variable_get('googleanalytics_js_scope', 'header');
-
+    // We allow different scopes. Default to 'footer' but allow user to override if they really need to.
+    $scope = variable_get('googleanalytics_js_scope', 'footer');
+    
     // Custom tracking. Prepend before all other JavaScript.
-    if (variable_get('googleanalytics_trackadsense', FALSE)) {
-      $page['footer']['googleanalytics']['#attached']['js']['window.google_analytics_uacct = ' . drupal_json_encode($id) . ';'] = array(
-        'type' => 'inline',
-        'scope' => 'header',
-        'weight' => JS_LIBRARY - 21,
-      );
-    }
-
+    drupal_add_js('window.google_analytics_uacct = ' . drupal_json_encode($id) . ';', array('type' => 'inline', 'weight' => JS_LIBRARY - 21));
+    
     // Add link tracking.
     $link_settings = array();
     if ($track_outgoing = variable_get('googleanalytics_trackoutgoing', 1)) {
@@ -96,12 +90,13 @@ function googleanalytics_page_alter(&$pa
       $link_settings['trackDownloadExtensions'] = $trackfiles_extensions;
     }
     if (!empty($link_settings)) {
-      $page['footer']['googleanalytics']['#attached']['js'][] = array(
+      $page['#attached']['js']['ga_link_tracking'] = array(
         'type' => 'setting',
         'data' => array('googleanalytics' => $link_settings),
       );
-      $page['footer']['googleanalytics']['#attached']['js'][drupal_get_path('module', 'googleanalytics') .'/googleanalytics.js'] = array('scope' => $scope);
+      drupal_add_js(array('googleanalytics' => $link_settings), 'setting');
     }
+    drupal_add_js(drupal_get_path('module', 'googleanalytics') .'/googleanalytics.js');
 
     // Add User profile segmentation values.
     $profile_fields = variable_get('googleanalytics_segmentation', array());
@@ -201,11 +196,7 @@ function googleanalytics_page_alter(&$pa
     $script .= 's.parentNode.insertBefore(ga, s);';
     $script .= '})();';
 
-    // Add tracker code to scope.
-    $page['footer']['googleanalytics']['#attached']['js'][$script] = array(
-      'type' => 'inline',
-      'scope' => $scope,
-    );
+    drupal_add_js($script, array('scope'=> $scope, 'type' => 'inline'));
   }
 }
 
