It’s seems that since Magento 1.4.2.0 upgrade, I don’t have any ecommerce data tracked by Google Analytics.
Here is the js code displayed on my checkout success page :
<!-- BEGIN GOOGLE ANALYTICS CODE --> <script type="text/javascript"> //<![CDATA[ (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga); })();
var _gaq = _gaq || [];
_gaq.push(function() { // the global variable is created intentionally pageTracker = _gat._getTracker('UA-XXXXXXXX-X'); pageTracker._trackPageview(); });
Are you using any other extensions related to google analytics? For me Google code was not appearing in the script so both analytics and eCommerce tracking was not working and even I was using Fooman Google Analytics extension.
If this might help you, here is what I had done.
After getting deeper in codes I found that using the code below to get Google code is no more used in Magento 1.4.2.0
$this->getAccount()
Even in file Ga.php, it has been mentioned that this function is deprecated
/** * @deprecated after 1.4.1.1 * @see _toHtml() * @return string */ public function getAccount() { return ''; }
So instead of using this function I fetched it using
Thank you but my problem is different. As you can see upper, I have a google analytics code displayed on checkout success page but this code doesn’t work for ecommerce tracking (it works for standard tracking).
Simular problem here. Strangely i do have the odd transaction coming up on the e-Commerce section of analytics but only a tiny percentage of the transactions that should be there.
I’ve checked the GA javascript is on the success page, no problem there. I notice that ‘Waiting for http://ssl.googleanalytics.com....’ is displayed for a minute or two implying the data is having trouble being sent.
I wonder if it is only tracking those very few clients who happen to leave their browser open long enough for the data to be sent ? This could explain why most of my transactions are not being tracked.
Just figured out that its only tracking my Google Checkout orders not any of my Paypal / CC ones (ignore my time out assumption above). One thing i changed after the upgrade way the Paypal \"Transfer Cart Line Items\” option to Yes. I\’ve reverted this to No and will see if this is causing the problem.
I\’ve reverted this to No and will see if this is causing the problem.
This isn’t the problem. Just checked google analytics e-commerce and its still just tracking the google checkout orders. :(
Ive also noticed that my Google Checkout orders are not being marked as shipped by Magento when checking the google checkout orders inbox. I wonder if this is related ?
Im still stuck on this problem. One thing i tried that didn’t work was to move the Analytics into the header section which was recommended by Google : http://code.google.com/apis/analytics/docs/tracking/asyncTracking.html
I’ve also noticed that the success page google analytics code differs a bit to the code i their example. Im going to try this next… Will post on what happens.
I’ve replaced my current Ga.php with the alpha1 version found here :
http://svn.magentocommerce.com/source/branches/1.5-trunk/app/code/core/Mage/GoogleAnalytics/Block/
I see the output change slightly so hopefully this will work out. Should know by tomorrow.
You can copy the file app/code/core/Mage/GoogleAnalytics/Block/Ga.php to app/code/local/Mage/GoogleAnalytics/Block/Ga.php
Then replace the method _getPageTrackingCode by :