One of our clients has Google Analytics configured for two sites. We have the GoogleAnalyticsWidgit conlib on the footer of every page on both sites, but for some reason only some orders are getting recorded in Google. About 50% of the orders placed aren't getting tracked. Has anyone else experienced this? I could understand if it was none of the orders, but can't figure out why it's just some of them.
Thanks.
Google Analytics only tracking some orders...
- gjaros
- AbleCommerce Partner
- Posts: 1717
- Joined: Tue Feb 24, 2004 2:20 pm
- Location: Illinois
- Contact:
Re: Google Analytics only tracking some orders...
I think I found the issue. Orders not coming across had " in one or more of the product names, for example if there was an order that contained Picture Frame - 24" by 36" the Google Analytics code wouldn't work. It looks like line 109 of GoogleAnalyticsWidget.aspx.cs needs to have double quotes stripped out. I changed the item.Name call from this:
To this:
Code: Select all
String itemLine = string.Format(itemLinePattern, _Order.OrderId, item.Sku, item.Name, GetItemCategory(item), string.Format("{0:F2}", item.Price), item.Quantity);
Code: Select all
String itemLine = string.Format(itemLinePattern, _Order.OrderId, item.Sku, item.Name.Replace("\"",""e;"), GetItemCategory(item), string.Format("{0:F2}", item.Price), item.Quantity);
Re: Google Analytics only tracking some orders...
Very helpful - I didn't even think about quotes throwing off the formatting. Able usually uses a StringHelper to clean stuff up before it gets sent/stored.
Did you see my post from a few weeks ago about the bug in 7.0.5 GA Widget? It's posting order total to the sales
tax column in GA eCommerce.
Did you see my post from a few weeks ago about the bug in 7.0.5 GA Widget? It's posting order total to the sales
tax column in GA eCommerce.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com
- gjaros
- AbleCommerce Partner
- Posts: 1717
- Joined: Tue Feb 24, 2004 2:20 pm
- Location: Illinois
- Contact:
Re: Google Analytics only tracking some orders...
Yeah, I did see that post when I was looking to see if anyone had run into the problem I was having. We've taken note of it so we can fix it for any of our clients needing it. Thanks.