diff --git a/commerce_google_analytics.module b/commerce_google_analytics.module
index 91d9ea958b7be7248ad7af9d0b4560745d2188a3..6f6b1af50869992b02c4e18b13cc2e9a1c4b051b 100644
--- a/commerce_google_analytics.module
+++ b/commerce_google_analytics.module
@@ -32,13 +32,16 @@ function commerce_google_analytics_enable() {
  *
  */
 function commerce_google_analytics_commerce_checkout_router($order, $checkout_page) {
+// Get Scope of the google analytics module
+  $scope = variable_get('googleanalytics_js_scope', 'footer');
 
   // Add the javascript only when we are on the order complete page
+  
   if ($checkout_page['page_id'] == 'complete') {
     $script = commerce_google_analytics_ecommerce_js($order);
     
-    // Add the code to the footer.
-    drupal_add_js($script, array('type' => 'inline', 'scope' => 'footer', 'preprocess' => FALSE));
+    // Add the code to the scope of the google analytics module.
+    drupal_add_js($script, array('type' => 'inline', 'scope' => $scope, 'preprocess' => FALSE, 'weight' => 10));
   }
   
 }
