Google Analytics Issue

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Google Analytics Issue

Post by mfreeze » Thu May 22, 2008 2:14 pm

The Google Analytics staff tested the code on one of my clients sites and sent her the following email.
Currently this is what the source code looks like:

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ?

"https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost +

"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-2791866-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>

Followed by some more source code, then:

<script language="JavaScript">
<!--


pageTracker._addTrans("51292","","96.00","0.00","0.00","test","FL","US");


pageTracker._addItem("51292","","Comfort Feel","Yellow Gold","96.00","1");
pageTracker._trackTrans();
// -->
</script>



Please have ._addTrans and ._addItem appear right after ._trackPageview.
Example:

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ?

"https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost +

"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-2791866-1");
pageTracker._initData();
pageTracker._trackPageview(); pageTracker._addTrans;
pageTracker._addItem;
pageTracker._trackTrans();
</script>



This will prevent the "double or triple item" bug in GA, as well as the "over 50% missing Ecommerce transactions" bug in GA, as well as being much cleaner and smoother of a data collecting / sending operation.

I looked at the source for the receipt page and did see code between the two sections. I then looked ate the google analytics conlib entries but could not see where this code was generated. The code in question starts with the line <div id="webpartsPanel"> and looks like the formatting for the page.

According to Google, no code should be between the gaJShost portion of the script and the pagetracker_adtrans portion. Can this be accomplished in the conlib member or is this an Able Commerce fix?
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

keats76
Commander (CMDR)
Commander (CMDR)
Posts: 117
Joined: Sat Dec 15, 2007 4:45 pm

Re: Google Analytics Issue

Post by keats76 » Thu May 22, 2008 4:39 pm

I'm not sure about everyone else ... but all I did was edit the scriptlet footers and put in my own analytics code. Of course, this means that you can't update it from the admin, but that's not a big deal to me.

Post Reply