1ShoppingCart & Google Analytics

google analytics header


Update – 3/5/2009 – I’ve been demo’ing the 1SC/Google Analytics integration quite a bit lately (to staff and others) and put together a little document to try and show the results of a successful implementation.  You can take a look at the document here!


On July 10, 2008 1ShoppingCart released a new Third Party Integration with Google Analytics to all Basic and Pro package accounts.

It’s a great feature that has been requested for ages and I’m happy to have been able to push it through.

Generally 1ShoppingCart doesn’t offer a ton of support or more than basic help information for our Third Party Integrations, typically letting each third party provider support their own products instead.

This usually isn’t an issue as most of our merchants using an integrated third party solution (henceforth referred to as TPS) tend to know more about that solution than we do. But Google Analytics seems to be a little bit different.

Not that we know more about Google Analytics than our merchants, but there is definitely a unique dynamic surrounding this particular integration that hasn’t occurred with any of our previous TPS integrations and I’ve been approached a few times for more information on how this new integration works

I’m sure that the major differentiator is simply that, while most of our TPSs are fairly specialized, Google Analytics is fairly mainstream and widely used (for obvious reasons… I use it myself!)

Anyway, I’ve talked to our support team about creating a guide of some sort, but in the meantime I thought I would clean up my notes and post them here as a short term solution.

*Disclosure: I don’t talk a lot about my great ‘day job’ here, so if I’m confusing any of you right now here’s the skinny: I’m a product manager for 1ShoppingCart.com (a web.com brand). There aren’t very many corners of the app that I haven’t had a heavy-hand in improving (and occasionally breaking – sorry about that) over the past few years and Google Analytics was one of my pet projects earlier this summer.

Google Analytics

google analytics example

This integration was pretty simple and straightforward, which is one of the major reasons I was able to sneak it into our busy development cycle.

The Basics

We took Google’s provided script and coded it right into our shopping cart process. The script itself is exactly the same for everyone using Google Analytics, with the exception of each user’s Unique Identifier (referred to within the script as the ‘UA’).

So all you have to do as a (Basic or Pro package) merchant of 1ShoppingCart is find your UA and type (or copy/paste) it into the Google Analytics field on the Setup >> Third Party Integrations menu within your account and then update your product links (to tell Google that the destination needs to be tracked also.)

The Slightly Tricky Stuff

The one caveat to this is:

You need to be using the CORRECT script on your own website to make this work… and you probably aren’t yet

Google provides 3 or 4 different scripts; there’s at least one legacy version (legacy=old… i.e. don’t use!) provided as an urchin.js file and 2 newer versions provided as ga.js files.

I’m not going to talk about the legacy version here other than to say: UPGRADE! The urchin.js file doesn’t even offer the same functionality as the newer versions, and it won’t work with the 1ShoppingCart Google Analytics Integration.

Of the two new versions, there is a standard version and another provided to ‘track a 3rd party shopping cart’ (that’s us!)

You’re most likely using the standard version on your site now (assuming you are using Google Analytics already of course) but will need to update your site to use the ‘track a 3rd party shopping cart’ version in order to use our Google Analytics integration.

The ‘track a 3rd party shopping cart’ Script

I included a link to Google’s help page at the bottom of this post; I pulled all my information from there but I’ve been told from less tech savvy people that Google’s pages are difficult to understand. I hope my explanation is a little easier to digest, but if not, just let me know!

1. Get the right Analytics Script – Copy the code that follows and paste it into all the pages on your site (typically you would do this one time in a standard, site-wide include; like a header).  This code must be placed ABOVE any product links, so don’t put it in your footer, or near the </body> tag which is often recommended:

<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 type=”text/javascript”>
var pageTracker = _gat._getTracker(“UA-xxxxxx-x”);

2. Add your Personal Identifier to the script - In the code above, replace the (“UA-xxxxxx-x”) with your actually UA #. As I understand it, the #’s between the dashes represents your individual Google account, and the last # represents which site profile you are tracking.

You can find your UA within your existing script or within your Google Analytics account:

From the appropriate site profile within your Google account, click EDIT from the Settings column. At the top right of the Main Website Profile Information box, click Check Status. Your standard tracking code will appear in the text box that appears in the ‘Instructions For Adding Tracking’ section.

3. Update your product links – This step may be a bit of pain for any merchants with a large number of products… sorry, but it’s the only way.

You have to add the following to the end of every link on your website that sends traffic to your shoppingcart on our site (again, make sure any links with this addition are LOWER in your code than the main analytics tracking javascript):

onclick=”pageTracker._link(this.href); return false;”

So, if your link looks like this currently (These are some test products on one of my accounts!):

<a href=”http://www.marketerschoice.com/SecureCart/SecureCart.aspx?mid=3C302D4E-0B99-40F9-99A7-F10D301CEFEB&pid=a5ad01402426c53ebd68f803e664b38f”> Buy Me </a>

It should look like this, after you add the new bits:

<a href=”http://www.marketerschoice.com/SecureCart/SecureCart.aspx?mid=3C302D4E-0B99-40F9-99A7-F10D301CEFEB&pid=a5ad01402426c53ebd68f803e664b38f” onclick=”pageTracker._link(this.href); return false;”> Buy Me </a>

4. Test that you did it right – When I was poking around I came across a service that offers Google Analytics Site Scans. If you have any doubts about whether or not you installed the Google script correctly, head over to http://www.sitescanga.com and see!

5. Watch your stats roll in!


If you want to go to the source, I’ve included links to pretty much all of the pages I visited to find the above information:

Google Analytics Site Scan:


Tracking Transactions:


Google analytics on an ecommerce site:


tracking a 3rd part shopping cart:


Confirm tracking code on site is correct:


*** Update 9/5/2008 – Apparently I forgot to talk about the all important aspect of Google Analytics Ecommerce Tracking… so I wrote another post.

*** Updated 2/2/2009 – I needed to clarify where in the code the main tracking script needs to be added.  It must go ABOVE any product links that include the _link parameter.

7 thoughts on “1ShoppingCart & Google Analytics”

  1. I am working with a client to integrate GA on 1Shopping cart. The problem is that in our goals Google is reporting more sales then are actually happening. Looking at the reverse funnel I can see that a lot of the visits being reported originate with the 1shopping cart page. A couple of these can be attributed to visits by the client or myself, but many more aren't.

    I've checked with other companies that do this work and the consensus seems to be that one can't get perfectly clean data using GA and 1shopping cart.

    I am wondering if in your testing “Update – 3/5/2009 – I’ve been demo’ing the 1SC/Google Analytics integration quite a bit lately (to staff and others) and put together a little document to try and show the results of a successful implementation” you're seeing anything similar?

  2. Does that custom tracking script also need to go on the shopping cart pages themselves as well? And do the links to the shopping cart need to point to the mcssl.com domain or can they point to the 1shoppingcart.com domain where they are then redirected to the mcssl.com pages? Does this ruin the integrity of the information?


  3. I really like 1 Shopping Cart, but the lack of support on this feature is pretty frustrating. I am so glad I found your blog, but even after doing this (and of course going through the limited information available on the 1SC site) I still can't get this to work. It's making me consider moving to another shopping cart platform. Do you know of anyone who has gotten this to work, or anyone who can help someone get it working?

  4. I am trying (fruitlessly I must add) to implement GA through 1shoppingcart. However, it doesn’t seem like this is even possible the way that it setup on the 1sc side, primarily because when I link my pages to you they get bounced all over heck and back. I’ve managed to reduce that someone by making my buy buttons go to mcssl.com rather than 1sc, however it appears that the link functions aren’t being invoked when the customer is being transferred back to my site after the purchase. Can you point us to an example of complete integration of 1sc and ga? From what I’m seeing I’m loosing hope that I can actually do it…..

Comments are closed.