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 3 of 3
No Google Analytics eCommerce tracking data since Magento 1.4.2.0 upgrade
 
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
 
hollyscott
Jr. Member
 
Total Posts:  5
Joined:  2014-03-17
 

Hi !

We could have a good solution for you ...:

http://restaurant.web-cooking.net/seo/magento-google-universal-analytics.html

By choosing server-side system, you will have an exact conversion rate!

Hope it can be helpful ^^

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 3 of 3