Author |
Topic |
|
norik000
Starting Member
USA
43 Posts |
Posted - February 12 2008 : 04:32:43
|
As you might know, Google has announced a new tracking code for their Analytics. http://analytics.blogspot.com/2007/12/announcing-new-graphing-tools-gajs.html
As a consequence of this new release, they will not update the urchin.js anymore.
So I thought this guide might be helpful for people that would want to use the benefits of new Google Analytics tracker ga.js
to implement this new code go to
Around line 1904 on shopproductsubs.asp
find the following code:
============================== sub inserturchinstats if getconfig("xurchinstats") = "Yes" then 'VP-ASP 6.09 - Updated Urchin SSL URL%> <script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript" language="javascript"></script> <script type="text/javascript" language="javascript"> _uacct="<%=getconfig("xurchinacctno")%>"; urchinTracker(); </script> <%end if end sub ==============================
and replace with:
============================== sub inserturchinstats if getconfig("xurchinstats") = "Yes" then 'VP-ASP 6.09 - Updated Urchin SSL URL%> <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("<%=getconfig("xurchinacctno")%>"); pageTracker._initData(); pageTracker._trackPageview(); </script> <%end if end sub ==============================
Please Note:
Google recommends: "Note: We recommend that you do not include both tracking code snippets together on any given page. Doing so might generate inaccurate report data. You can, however, migrate select pages of your site to the new tracking code while the legacy code remains on others."
Moreover, Google recommends to insert the tracking code right before the </body> tag, which in my opinion will give you a better prespective on page loads and internet speeds of your users.
to do so:
you can Move the
==============================
<%inserturchinstats%>
==============================
from shoppage_header.htm around line 8
to shoppage_trailer.htm and place the code before the ==============================
</body>
============================== closing body tag.
I hope this guide was helpful.
Regards, Norik
------------------------------- www.Parscat.com <signature>3D</signature> |
Edited by - norik000 on February 12 2008 09:59:50 |
|
escort
Starting Member
32 Posts |
Posted - June 17 2008 : 09:48:54
|
I tried as suggested in this topic but I need order information for calling pagetracker._addtrans and _additem. If I call inserturchine just before /body tag it seems that orderid is cleared from session and it does not find the order anymore. Any suggestion on resolving this problem will be very much appreciated. Thanks |
|
|
gogogear
Starting Member
25 Posts |
Posted - February 02 2009 : 19:29:40
|
how exactly do we add the ecommerce part of the tracking? ie: "Next, somewhere in the receipt below the tracking code, call the _addTrans() and _addItem() functions. Begin with a call to _addTrans() to establish a transaction. _addTrans() takes the following arguments: Order ID,Affiliation, Total, Tax, Shipping, City, State, Country. For each item that the visitor purchases, call _addItem(). _addItem() takes the following arguments: Order ID, SKU or Code, Product Name, Category, Price, Quantity. " |
|
|
Lori Titus
VP-CART New User
144 Posts |
Posted - February 06 2009 : 19:40:36
|
Ditto for me. Google Analytics seems to be catching the visitors to my website, but I'm not getting any ecommerce data. Javascript is something I'm not familiar with. Can anyone explain how to pass the order info through to Analytics?
The Internet's #1 supplier of honey and beeswax. |
|
|
Lori Titus
VP-CART New User
144 Posts |
Posted - February 15 2009 : 12:16:22
|
Don't know why support did not mention it, but they have an add-on module for 6.5 that contains the new Google Analytics code, including the _addTrans and _addItem functions. Installed it last night on my site, and it seems to run well.
Only hitch was that my ability to download the addons expired about a year ago, so I had to renew my license in order to have the privilege to download the addon. Still, the code for this was such that I never, ever would have figured it out on my own. Plus, there are some new addons since last time I looked.
The Internet's #1 supplier of honey and beeswax. |
|
|
Mark Priest
VP-CART Expert
United Kingdom
580 Posts |
Posted - May 20 2009 : 20:57:58
|
I must admit I think the way that VPASP announce add-ons is very poor, I would have upgraded ages ago for this functionality!
Regards,
Mark Fireworks UK |
|
|
|
Topic |
|