I have made the edits suggested, but still do not see ecommerce transactions in GA. Not sure if the posts i was reading were old, but i went through and did a transaction and got to https://www.zuzii.com/checkout/onepage/success/ only to find nothing refering to GA other than this :
<script type="text/javascript">
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-xxxxxxxx-x']); _gaq.push(['_trackPageview']);
(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'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();
</script> <!-- other -->
im fairly rough around the edges, please be gentle, i just wanna start figuring out why my conversions are low, thanks in advance!
There can be a certain delay between the purchase and it appearing in Google Analytics. After a day or two, if the purchase does not register in GA, then you can be certain that the GA Magento module is not working properly.
Faken, what do you mean “recompile”? Not sure what you are talking about. I’ve cleared my cache dozens of times since I made the change. Makes no difference. Still no ecommerce data :(
Magento can use compilation to speed things up. Each time you replace/override certain classes/code, you will need to recompile Magento in order to use the new code.
Check if you are using compilation by going to System => Tools => Compilation, and check out the “Compiler Status”. If it is enabled, you need to recompile: just click the button “Run Compilation Process” on the top right. After that you should be able to see your changes.
Note that if your “Compilation Status” was disabled, then compilation is not the problem… However, if you use compilation, always recompile after code changes.
I had this problem with 1.4.2 and can confirm that I applied owebia’s fix (posted on January 20 2011) and it works!
Many thanks haligonia for reporting success… I have implemented owebia fix and have tested that the correct code is being used by Magento for GA on the sucess page… I await ecommerce stats from GA.
One thing that I have found strange about this issue is that I have other sites using Mage 1.4.2 which continue to record ecommerce stats to GA, only one site exhibits this issue… The only difference I see between these Magen installs, is the one with the problem is a Multi Store site.
The general GA code seems to be inserting fine but the ecommerce tracking code for ga is being omitted.
After some digging, I’ve discovered that protected function _getOrdersTrackingCode() in Ga.php seems to be having issues. It’s being called but it seems that:
$orderIds = $this->getOrderIds();
Is returning an empty array and so the _getOrdersTrackingCode() returns nothing.
I’f anyone has any ideas about how I can solve that, I’d love to hear.
I’d really like to know this as well because i’m dealing with this issue. I’ve searched and searched and found different threads where people suggest changing XML files along with observer.php and other posts where people say just change the GA.php file and i’m okay on 1.4.2.0.
I’ve changed the GA.php file and still nothing.. so i’m wondering if there is a thread or site out there thas has a complete fix, step by step.