Some Test Results and Patch

dub4u's picture
Offline
Joined: 03/14/2008
Juice: 7
Some Test Results and Patch

Thanks for taking up the effort torgosPizza. I did some more investigation in this using Firefox' Live HTTP Headers extension. After removing the trailing commas the pageTracker._addTrans() definitely fired, i can see the data being transferred to http://www.google-analytics.com/__utm.gif. So there is no issue with the separate tags (and there should not be anyway).

Whether the data sent can be handled correctly by Google, I do not know. So far, I can not see any transactions. Do I have to define some goals for this in Analytics or is it sufficient to mark your site as an e-commerce site? Does the data show up immediately in Analytics? Sorry for these questions, I am new to Analytics.

While digging into this, I noticed an undefined call to __utmSetTrans() in the JS error console. This error however, I do not believe causes any problem, it is just an annoyance. To get rid of it I propose this patch:

--- uc_googleanalytics.module.bak       2008-03-14 01:40:25.613947962 -0700
+++ uc_googleanalytics.module   2008-03-14 01:40:38.114660337 -0700
@@ -36,7 +36,9 @@
       $script .= _uc_googleanalytics_ecommerce_form($order);
       $_SESSION['uc_googleanalytics_order_id'] = NULL;
       unset($_SESSION['uc_googleanalytics_order_id']);
-      drupal_add_js('$(document).ready(function() { __utmSetTrans(); });', 'inline');
+      IF (VARIABLE_GET('googleanalytics_legacy_version', TRUE) == TRUE) {
+          drupal_add_js('$(document).ready(function() { __utmSetTrans(); });', 'inline');
+      }
     }
   }
   return $script;

If anyone can comment on my questions about how Analytics and e-Commerce Tracking works, let me know so I can dig further into getting GA tracking work with Ubercart.

uc_googleanalytics doesn't work with Latest GA Tracking code! (Fix attached) By: torgosPizza (43 replies) Thu, 03/06/2008 - 14:15