FIX: AC 7.0.5 Google Analytics not accurate
Posted: Tue Sep 07, 2010 10:04 am
The Google Analytics widget was rewritten in 7.0.5 and now it's bugged. If you are using this and report eCommerce statistics to Google, you might have noticed that sales are being lumped into Taxes instead of Order Totals.
In the code, you'll see that the taxTotal variable is updated and the orderTotal variable never gets touched.
The fix is simple, just edit the /ConLib/GoogleAnalyticsWidget.ascx.cs file and find this code:
And change the last line:
to
To my knowledge, there is no way to correct the existing data in Google Analytics eCommerce. I'm not all that familiar with GA though, so don't that as gospel 
In the code, you'll see that the taxTotal variable is updated and the orderTotal variable never gets touched.
The fix is simple, just edit the /ConLib/GoogleAnalyticsWidget.ascx.cs file and find this code:
Code: Select all
switch (item.OrderItemType)
{
case OrderItemType.Shipping:
case OrderItemType.Handling:
shippingTotal += extendedPrice;
break;
case OrderItemType.Tax:
taxTotal += extendedPrice;
break;
default:
break;
}
taxTotal += extendedPrice;
Code: Select all
taxTotal += extendedPrice;
Code: Select all
orderTotal += extendedPrice;
