diff --git a/commerce_google_analytics.module b/commerce_google_analytics.module
index 163f4d7..4a48644 100644
--- a/commerce_google_analytics.module
+++ b/commerce_google_analytics.module
@@ -106,20 +106,7 @@ function commerce_google_analytics_ecommerce_js($order) {
   // Allow modules to alter the transaction arguments.
   drupal_alter('commerce_google_analytics_transaction', $transaction, $order);
 
-  // Put the arguments into an array that is safe to implode directly.
-  $args = array(
-    '"' . $transaction['order_id'] . '"',
-    drupal_json_encode($transaction['store']),
-    '"' . $transaction['total'] . '"',
-    '"' . $transaction['tax'] . '"',
-    '"' . $transaction['shipping'] . '"',
-    drupal_json_encode($transaction['city']),
-    drupal_json_encode($transaction['state']),
-    drupal_json_encode($transaction['country']),
-  );
-
-  // Add the transaction line to the JS.
-  $script .= '_gaq.push(["_addTrans", ' . implode(', ', $args) . ']);';
+  $items = array();
 
   // Loop through the products on the order.
   foreach ($order->commerce_line_items as $line_item) {
@@ -158,26 +145,38 @@ function commerce_google_analytics_ecommerce_js($order) {
       'transaction' => $transaction,
       'order' => $order,
     );
+
     drupal_alter('commerce_google_analytics_item', $item, $line_item, $context);
 
     // Put the arguments into an array that is safe to implode directly.
-    $args = array(
-      '"' . $item['order_id'] . '"',
-      drupal_json_encode($item['sku']),
-      drupal_json_encode($item['name']),
-      drupal_json_encode((string) $item['category']),
-      '"' . $item['price'] . '"',
-      '"' . $item['qty'] . '"',
+    $items[] = array(
+      $item['order_id'],
+      $item['sku'],
+      $item['name'],
+      (string) $item['category'],
+      $item['price'],
+      $item['qty'],
     );
-
-    // Add the item line to the JS.
-    $script .= '_gaq.push(["_addItem", ' . implode(', ', $args) . ']);';
   }
 
-  // Add the function to submit the transaction to GA.
-  $script .= '_gaq.push(["_trackTrans"]);';
+  $push = array(
+    'trans' => array(
+      $transaction['order_id'],
+      $transaction['store'],
+      $transaction['total'],
+      $transaction['tax'],
+      $transaction['shipping'],
+      $transaction['city'],
+      $transaction['state'],
+      $transaction['country'],
+    ),
+    'items' => $items,
+  );
+
+  // Call the API function provided by the ga_push module to send the data to Google Analytics.
+  ga_push_add($push, 'ecommerce');
 
-  return $script;
+  return TRUE;
 }
 
 /**
@@ -190,24 +189,6 @@ function commerce_google_analytics_ecommerce_js($order) {
  *   The order object
  */
 function commerce_google_analytics_send_order($order) {
-  // 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.
-  $script = commerce_google_analytics_ecommerce_js($order);
-  $_SESSION['ga_push_commerce'] = $script;
-}
-
-/**
- * Implements hook_init().
- */
-function commerce_google_analytics_init() {
-  if (!empty($_SESSION['ga_push_commerce'])) {
-    $script = $_SESSION['ga_push_commerce'];
-    $scope = variable_get('googleanalytics_js_scope', 'footer');
-    drupal_add_js($script, array(
-      'type' => 'inline',
-      'scope' => $scope, 'preprocess' => FALSE,
-      'weight' => 10));
-    unset($_SESSION['ga_push_commerce']);
-  }
+  commerce_google_analytics_ecommerce_js($order);
 }
