Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 3
No Google Analytics eCommerce tracking data since Magento 1.4.2.0 upgrade
 
Prad
Member
 
Total Posts:  72
Joined:  2008-11-12
 

Great.
This will certainly help everyone using new stable version.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sdz123
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2008-07-24
Technomadic
 

Excellent. Im seeing eCommerce transactions in my Google Analytics now smile

Sorted.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cristin ryan campbell
Jr. Member
 
Total Posts:  1
Joined:  2010-04-07
 

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 
document.getElementsByTagName('script')[0]s.parentNode.insertBefore(gas);
  
})();

</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!

 
Magento Community Magento Community
Magento Community
Magento Community
 
faken
Jr. Member
 
Total Posts:  16
Joined:  2009-11-13
 

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.

 
Magento Community Magento Community
Magento Community
Magento Community
 
elitriona
Sr. Member
 
Total Posts:  106
Joined:  2008-10-23
 

I tried updating the ga file as suggested previously, then waited a few days. But still does not seem to be getting any ecommerce data.

 
Magento Community Magento Community
Magento Community
Magento Community
 
faken
Jr. Member
 
Total Posts:  16
Joined:  2009-11-13
 

After making the suggested code change confirm that you clear the cache and recompile, or else the change will take no effect.

 
Magento Community Magento Community
Magento Community
Magento Community
 
elitriona
Sr. Member
 
Total Posts:  106
Joined:  2008-10-23
 

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 Community Magento Community
Magento Community
Magento Community
 
faken
Jr. Member
 
Total Posts:  16
Joined:  2009-11-13
 

Hi,

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.

Hope this helps smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
elitriona
Sr. Member
 
Total Posts:  106
Joined:  2008-10-23
 

Thanks for the info Faken! Unfortunately compiler status is disabled for me, so that is not the problem :(

 
Magento Community Magento Community
Magento Community
Magento Community
 
haligonia
Sr. Member
 
Total Posts:  97
Joined:  2009-02-28
 

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!

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageClub
Guru
 
Avatar
Total Posts:  386
Joined:  2009-07-25
India
 

The best solution would be upgrading to 1.5.x then..

 
Magento Community Magento Community
Magento Community
Magento Community
 
Flipmedia
Member
 
Avatar
Total Posts:  43
Joined:  2009-09-24
 
haligonia - 06 May 2011 08:38 AM

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.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Timmwardion
Jr. Member
 
Total Posts:  2
Joined:  2011-09-27
 

I’m having a similar problem on Magento 1.6.

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.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Pdubb
Jr. Member
 
Total Posts:  10
Joined:  2010-12-22
 

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.

Thanks,

P

 
Magento Community Magento Community
Magento Community
Magento Community
 
chiefair
Mentor
 
Avatar
Total Posts:  1848
Joined:  2009-06-04
 

The basic goofiness with which certain upgrades are taken where lyrical code insanity prevails…

protected function _getPageTrackingCode($accountId)
    
{
        $optPageURL 
trim($this->getPageName());
        if (
$optPageURL && preg_match('/^\/.*/i'$optPageURL)) {
            $optPageURL 
"'{$this->jsQuoteEscape($optPageURL)}'";
        
}
        
// the code compatible with google checkout shortcut (it requires a global pageTracker variable)
        
return "
_gaq.push(function() {
    // the global variable is created intentionally
    pageTracker = _gat._getTracker('{
$this->jsQuoteEscape($accountId)}');
    pageTracker._trackPageview({
$optPageURL});
});
"
;
    
}

turns _gaq.push into a funky charlie foxtrot function for no real good reason. The stock Google tracking code leaves it open for additional lines to get collated and shoved in Google’s direction. So if you were doing event tracking, or heaven forbid, cart funnel analysis to find out how Magento’s cart delightfully breaks for your customers, suddenly it all gets shut down.

protected function _getPageTrackingCode($accountId)
    
{
        $pageName   
trim($this->getPageName());
        
$optPageURL '';
        if (
$pageName && preg_match('/^\/.*/i'$pageName)) {
            $optPageURL 
", '{$this->jsQuoteEscape($pageName)}'";
        
}
        
return "
_gaq.push(['_setAccount', '{
$this->jsQuoteEscape($accountId)}']);
_gaq.push(['_trackPageview'{
$optPageURL}]);
"
;
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 3