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

Same Google Analytics Problem! 
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

The pagetracker is been duplicated!

pageTracker._trackPageview("catalog/product/view/id/5661/catalog/product/view/id/5661")

previous topic:

http://www.magentocommerce.com/boards/viewthread/23536/

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

friends,

any custom patch that could be applied?

regards,

 
Magento Community Magento Community
Magento Community
Magento Community
 
TheChief79
Jr. Member
 
Total Posts:  4
Joined:  2008-07-23
 

Fot me it seems to be working, if i comment out this line:

$queryStr substr($request->getRequestUri(), strpos($request->getRequestUri(), '?'));

in app/code/core/Mage/GoogleAnalytics/Block/Ga.php

but a patch which replaces

pageTracker._trackPageview("catalog/product/view/id/8/category/4");

with

pageTracker._trackPageview("category/product.html");

would be great.

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

thanks..

I just changed it…

let´s see if the e-commerce revenue will be filled too.

the transactions are been catched ...

tomorrow I´ll have more news.

regards,

 
Magento Community Magento Community
Magento Community
Magento Community
 
purplemine
Sr. Member
 
Total Posts:  143
Joined:  2008-05-20
London
 

Same problem here, that line commented out seems to have done the trick for the moment!

Thanks,

 
Magento Community Magento Community
Magento Community
Magento Community
 
andreladocruz
Guru
 
Total Posts:  322
Joined:  2008-05-07
Brazil
 

sirs,

the problem with the revenue and the gols convertions are still happening.

with this we cannot track our campains well....

what a shame....

add a very good new function (google website optimizer and google base) setting down a working function.

when Magento team will say how to solve this problem?

Regards,

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 

Any update on this?  It’s incredible that we can no longer track sales values.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michae1
Enthusiast
 
Total Posts:  826
Joined:  2007-08-31
 

Can you please try the file attached ?

Or replace these lines

if ($request Mage::app()->getFrontController()->getRequest()) {
    $queryStr 
substr($request->getRequestUri(), strpos($request->getRequestUri(), '?'));
}

with the following ones:

if ($this->getRequest() && $this->getRequest()->getQuery()) {
    $queryStr 
'?' http_build_query($this->getRequest()->getQuery());
}
File Attachments
Ga.php  (File Size: 6KB - Downloads: 305)
 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 
Michael - 11 December 2008 01:45 PM

Can you please try the file attached ?

Or replace these lines

if ($request Mage::app()->getFrontController()->getRequest()) {
    $queryStr 
substr($request->getRequestUri(), strpos($request->getRequestUri(), '?'));
}

with the following ones:

if ($this->getRequest() && $this->getRequest()->getQuery()) {
    $queryStr 
'?' http_build_query($this->getRequest()->getQuery());
}

Done.

I presume this won’t fix the conversion tracking, though, right?

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 
redpen - 11 December 2008 11:56 PM


I presume this won’t fix the conversion tracking, though, right?

It doesn’t.  Analytics is still not counting our transactions.  I think Google Checkout transactions are working, but not ones through the Magento basket.  Any word on a fix for this please?

 
Magento Community Magento Community
Magento Community
Magento Community
 
team_in_medias
Sr. Member
 
Avatar
Total Posts:  113
Joined:  2008-05-06
Aachen, Germany
 

Regarding the missing transaction tracking:

The necessary javascript link pageTracker._addTrans(...); doesn’t work in 1.1.8. There is a line break missing, it shows

//<![CDATA[pageTracker._addTrans(...);

instead of

//<![CDATA[
pageTracker._addTrans(”...);

You can add the line break in /app/code/core/Mage/GoogleAnalytics/Block/Ga.php, change line 93 to

$html .= ‘//<![CDATA[’ . “\n”;

The “\n” was missing.

 
Magento Community Magento Community
Magento Community
Magento Community
 
redpen
Sr. Member
 
Total Posts:  254
Joined:  2008-01-23
 

Magic, thank you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
reefgear
Jr. Member
 
Total Posts:  23
Joined:  2007-11-06
 

The Ga.php file shows,

$html = ‘<script type="text/javascript">’ . “\n”;
$html .= ‘//<![CDATA[’;
$html .= ‘pageTracker._addTrans(’;
$html .= ‘”’ . $order->getIncrementId() . ‘“,’;
$html .= ‘”’ . $order->getAffiliation() . ‘“,’;
$html .= ‘”’ . $order->getGrandTotal() . ‘“,’;
$html .= ‘”’ . $order->getTaxAmount() . ‘“,’;
$html .= ‘”’ . $order->getShippingAmount() . ‘“,’;
$html .= ‘”’ . $address->getCity() . ‘“,’;
$html .= ‘”’ . $address->getRegion() . ‘“,’;
$html .= ‘”’ . $address->getCountry() . ‘“‘;
$html .= ‘);’ . “\n”;

foreach ($order->getAllItems() as $item) {
$html .= ‘pageTracker._addItem(’;
$html .= ‘”’ . $order->getIncrementId() . ‘“,’;
$html .= ‘”’ . $item->getSku() . ‘“,’;
$html .= ‘”’ . $item->getName() . ‘“,’;
$html .= ‘”’ . $item->getCategory() . ‘“,’;
$html .= ‘”’ . $item->getPrice() . ‘“,’;
$html .= ‘”’ . $item->getQtyOrdered() . ‘“‘;
$html .= ‘);’ . “\n”;

would you move the “/n” down to ‘//<![CDATA[’;

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top