diff --git sites/all/modules/google_analytics/googleanalytics.module sites/all/modules/google_analytics/googleanalytics.module
index e457e3e..8e18aee 100644
--- sites/all/modules/google_analytics/googleanalytics.module
+++ sites/all/modules/google_analytics/googleanalytics.module
@@ -82,7 +82,28 @@ function googleanalytics_init() {
       drupal_add_js(array('googleanalytics' => $link_settings), 'setting', 'header');
       drupal_add_js(drupal_get_path('module', 'googleanalytics') .'/googleanalytics.js', 'module', 'header');
     }
+    
+    $script = '(function() {';
+    $script .= 'var ga = document.createElement("script");';
+    $script .= 'ga.type = "text/javascript";';
+    $script .= 'ga.async = true;';
+
+    // Should a local cached copy of ga.js be used?
+    if (variable_get('googleanalytics_cache', 0) && $url = _googleanalytics_cache('http://www.google-analytics.com/ga.js')) {
+      $script .= 'ga.src = "' . $url . '";';
+    }
+    else {
+      $script .= 'ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";';
+    }
+    $script .= 'var s = document.getElementsByTagName("script")[0];';
+    $script .= 's.parentNode.insertBefore(ga, s);';
+    $script .= '})();';
+    
+    drupal_add_js($script,'inline','header');
+    
   }
+  
+  
 }
 
 /**
@@ -215,22 +236,6 @@ function googleanalytics_footer($main = 0) {
       $script .= $codesnippet_after;
     }
 
-    $script .= '(function() {';
-    $script .= 'var ga = document.createElement("script");';
-    $script .= 'ga.type = "text/javascript";';
-    $script .= 'ga.async = true;';
-
-    // Should a local cached copy of ga.js be used?
-    if (variable_get('googleanalytics_cache', 0) && $url = _googleanalytics_cache('http://www.google-analytics.com/ga.js')) {
-      $script .= 'ga.src = "' . $url . '";';
-    }
-    else {
-      $script .= 'ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";';
-    }
-    $script .= 'var s = document.getElementsByTagName("script")[0];';
-    $script .= 's.parentNode.insertBefore(ga, s);';
-    $script .= '})();';
-
     drupal_add_js($script, 'inline', 'footer');
   }
 }
