Veracart Shopping Cart Software | Ecommerce KnowledgeBase

Knowledgebase Home Knowledgebase Home
Search the Knowledgebase Browse by Category

"How do I setup Google Analytics Ecommerce Tracking on my store, and how does it help me ?"

User Opinions
No users have voted.

How would you rate this answer?
Helpful
Not helpful

Short Answer:

This requires a few steps in order to work, but is very useful to a merchant as Google Analytics can provide a very in-depth look at your online business as it allows you to track your ROI (return on investment).  E.g.  Put a dollar into your website, get back five.  Spend a hundred hours on optimizing your site, figure out the dollar return.  As you can know, identifying where your time and money is spent is vital to running any business. 

Notes:  If you are only looking for basic reporting, you can just install the basic GA (Google Analytics) tracking, or see the related article at the end of this page for even easier options.   If you are looking just to track your PPC (pay-per-click) advertising (e.g. Adwords), see the related article at the end of this page.

With the full GA ecommerce Tracking, you will be able to track where each and every order came from whether it's from:

  • Organic/natural (non-paid) search engine traffic.
  • Including which keywords, and which search engines they came from, etc.
  • Email marketing campaigns
  • Link, banner, PPC (pay per click) advertising
  • Visitors that originated from another website
  • Shopping feeds
  • Almost any other advertising you may be doing
  • Offline advertising that is directed to your website (requires extra steps)

You will not only know where they came from but you will also know:

  • How much the shopper is spending
  • What they are buying
  • Average order amounts
  • Etc...

Examples of things you might learn:

  • Sources that are producing below average conversion rates
  • Sources that are sending you higher than normal order sizes
  • That a certain geographic/demographic loves a certain type of product you are selling, so you decide to better target them
  • That a certain email campaign had a great click-through rate, but did not convert well.
  • A whole lot more

Actual examples tracking your ROI:

  • You spent $250 on an online telephone book listing, or text-link ad.  It results in $5,000 in sales in the follow six months (good).
  • You hired a search engine optimization company last year for $2,000, but the keywords they optimized your site for only resulted in $300 in sales (not good).
  • You ran two different email newsletters side-by-side, and discovered that the first campaign resulted in twice as many orders (so you continue the first campaign).
  • You setup a Yahoo Shopping feed, and it's returning a 200% return on investment (good).
You can learn more about Google Analytics from Google Analytics Product Tour as well as find some practical 'how-to make use of the data' oriented videos lisetd on this page.  

In short, help you to get a very clear picture on your return on investment (ROI) to all of your marketing efforts.

Tracking individual advertising and email campaigns will require a few extra steps not covered here (listed at the end of this guide)

Detailed Explanation:

The installation of e-commerce tracking is a bit technical for some, and does require several steps. If you would like us to do it for you, please do not hesitate to contact us. You can do these steps in any order. Much of this documentation is contained on Google Analytics help website as well.  If you have completed these steps, and things are not working as expected, you can also contact Google.

Log into your Google Analytics account

Or get a Google Analytics account, if you do not have one.

Enable the ecommerce tracking feature

If you are setting up an account for the first time, it will ask you if it is an ecommerce site; say "yes". If you already setup your site previously, you can check that this is indeed enabled by:

  • On the main after logging in ("Analytics Settings"), click "Edit" next to your domain.
  • Then on the main bar titled "Main Website Profile Information" click the "Edit" link to the right.
  • Under E-Commerce Website set it to "Yes", and save your changes

Exclude query parameters

This setting is found on the same page as described in the previous step. In the field "Exclude URL Query Parameters:" add this: VCS

Define a GOAL

We need to tell Google where our conversion page is located. To do that, we need to setup a goal:

  • From your main main page ("Analytics Settings"), click the "Edit" link.
  • Add a new goal under the goals section called "Conversion Goals and Funnel"
  • For the "Match Type" change the option to "Head Match"
  • For the "Goal URL" you will need to put in the URL of your receipt page. You may need to make a test order to find out what this is on your particular store. In this example, mine looks like this:
     
    https://secure1.somedomain.com/vc/cart/secure_checkout.html?ren=281af3934f499421684cb686f7607526&vccs=done
     
    In fact, you can use this same URL above if you just modify it a bit. Below, we've highlighted the two things you will need to change

    https://secure1.somedomain.com/vc/cart/secure_checkout.html?ren=281af3934f499421684cb686f7607526&vccs=done

    When you get to the last step of your checkout just before paying, you can see in the address bar that there will be some letters ren= which is followed by several numbers. You just need to use your number instead of the one in my example above. The other part is noticing the server you are on when you are checking out, whether its secure1.somedomain.com, secure2.somedomain.com, secure.somedomain.com, etc... Update this as well.

Important note: You must use the GA version of the code.

This will not work with the old "Legacy Tracking Code (urchin.js)." Please use the New "Tracking Code (ga.js)" instead. Your can view the source code on your website to see which version you are using. If you need to upgrade to the new version, you can find it by clicking on the "Edit" link next to your website domain (from the main "Analytics Settings" page), then clicking the "Receiving Data (Check Status)"

Copy and paste the code on your website just before the closing HEAD tag in your HTML (we are going to modify it in just a minute). Normally, this code is placed just before the closing BODY tag; but the exception is when you are using the ecommerce tracking feature. You are going to add these two extra lines to your tracking code towards the end of the code:

pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);

Here is what it should look like when you are done (if you copy and paste this code, be sure to use the right profile number like this "UA-123456" instead of "UA-XXXXXXXX"):

<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-XXXXXXXX");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._initData();
pageTracker._trackPageview();
</script>

Update your store's secure pages

If you recall, when you first setup your online store, you needed to upload your design to the secure pages such as the checkout and customer login (Under the "CODE" tab in your shopping cart account. Since you have added/edited the GA tracking code, you will need to update these pages again.  Go to CODE, then click the "Update" buttons under step #3 as needed.

Add the Conversion tracking code to the receipt page

Finally, from the shopping cart manager, you will need to insert some code provided by GA. This code will write/print out the order details on the receipt page in a special format (invisible to the shopper). Google reads this information to determine what was purchased, how much was spent, etc... The complete documentation can be found here.

In your shopping cart manager, go to SETTINGS > Checkout Settings, and add the following in the setting "Receipt Page Analytics Code"

<script type="text/javascript">
    pageTracker._addTrans(
     "[ORDERID]",   // Order ID
     "Veracart Online Order",  // Affiliation
     "[TOTAL]",    // Total
     "[TAX_TOTAL]",   // Tax
     "[SHIPPING]",   // Shipping
     "[SHIP_CITY]",   // City
     "[SHIP_STATE]",  // State
     "[SHIP_COUNTRY]"  // Country
    );
    [ITEMS]
    pageTracker._addItem(
     "[ORDERID]",   // Order ID
     "[ITEM_ID]",   // SKU
     "[NAME]",    // Product Name
     "[ATTRIBUTES]",  // Category
     "[PRICE]",   // Price
     "[QUANTITY]"   // Quantity
    );
    [/ITEMS]
    pageTracker._trackTrans();
</script>

We do not require you to modify the button that links to your secure checkout as defined in the GA help documentation.

You might be able to add or remove other elements that Google offers, but this is considered the typical setup.

You should know that by using this same "Receipt Page Analytics Code", your shopping cart can be integrated (in theory) with other analytic programs (e.g. Omnitures Site Catalyst, ClickTracks, etc...); as well as affiliate software programs that require you to write the order information out on the receipt page.

Other tracking features you may be interested in

  • Tracking email marketing, advertising, and offline-to-online marketing campaigns, etc..., requires that you setup a campaign and tag your links (pay attention to the page "How do I tag my links"). Search engine traffic, and traffic from other websites typically do not required such tagging.
  •  
  • Using the funnel feature to see where shoppers are leaving during the checkout process (untested)

Limitations

The tracking code may not track conversions that leave the shopping cart to go to another platform such as Paypal basic, Google Checkout, unless you provide a way to place the post data on the conversion page on their website.

Visitor Comments
No visitor comments posted. Post a comment
Related Questions
Attachments
No attachments were found.