| By: Brennan Heyde | Published On: 11/24/2007 |
Part II – Advanced Analytics: Goal Tracking
This is part II of a three part series on Google Analytics. You can read part I here:
Part I – Installing Google Analytics in Miva Merchant
Now that you have Google Analytics installed, you will be able to track important data about your visitors. Analytics will tell you where your visitors came from, what keyword they searched for to find you (if they came from a search engine), and how long they stayed. This is very useful information, but if you own an e-commerce store you also need to be tracking sales statistics such as customer conversion ratio, and checkout abandonment rate.
Google Analytics has two advanced features which allow you to track both of these statistics and also many more. The features are call Goal Tracking and Analytics for E-Commerce.
How to setup and install Google Analytics Goal Tracking for Miva Merchant
Goal tracking is useful for a few different things. It allows you to set up “Goals” which are events that you want your visitors to complete. Some example goals are signing up for a newsletter, requesting a catalog, or the main goal – completing a purchase on your site.
One of the best features of Goal tracking is it funnel visualization. You can set up a series of steps that your visitor must go through to complete a goal. The checkout process is a perfect example of this. You can see where your visitors are abandoning their cart during the checkout process. Here is an example:

As you can see 15 people started the checkout process and 3 actually made a purchase. This is very valuable data which will allow you to see if you have any problems with your checkout. If a large percentage of visitors were leaving at the shipping page, this would probably indicate that your shipping prices are too high.
Here is how to set it up -
In your Google Analytics account admin homepage, click on the edit settings link for your website. This will bring you to the settings page. You will see a section called Conversion Goals and Funnels.

Click the “edit” link again on the right hand side in the G1 line.

Above you can see that we are defining a series of steps which lead up to our goal. Here we are defining the Miva Checkout process. There are 4 parts to Miva Checkout:
Here is what you should enter for each of the fields above
Goal URL – This is the URL you are trying to get your customers to get to. For a completed purchase it is the invoice screen in Miva. Because Miva does not pass the screen codes as URL parameters during checkout, we have to assign it a new name just for tracking purposes.
Enter: https://www.yoursite.com/funnel_G1/checkout.html
If you are not using an SSL or you have a shared SSL your checkout pages URL will probably look like this: http://yoursite.hostasaurus.com
If that is the case use that URL followed by “funnel_G1/checkout.html”. An easy way to get you checkout URL is just add a product to your cart and checkout. When you get to the customer information screen, look at the URL is the box at the top of your browser. Copy everything up to the end of the .com. Now just add “/funnel_G1/checkout.html” to that URL and you are good to go. This is your Goal URL.
Goal Name – Assign your goal a name. It this case I used “Purchase Made”
Goal Steps 1 through 3 – Here you are tracking each individual checkout screen. It will use the same beginning URL you used for your Goal URL followed by the /funnel_G1/ and then a name for the screen. It should look like this:
https://www.yoursite.com/funnel_G1/address.html
https://www.yoursite.com/funnel_G1/shipping.html
https://www.yoursite.com/funnel_G1/payment.html
Again give these an appropriate name. I used Address, Shipping, and Payment respectively.
For the additional settings use the following:

If wish to assign each purchase a value then you can enter that in the Goal value box. Otherwise just leave it at 0.
Hit “Save Changes” and you are all done.
The last step in this process is to add some code to the global body tag of our Miva Store. Login to your Miva Admin and navigate to your global body tag.
If you are using Miva 5 you will enter the following code:
<!--Google Analytics Funnel Tracking Code -->
<mvt:if expr="(g.screen EQ 'OCST')">
<body onLoad="javascript:urchinTracker('/funnel_G1/address.html')">
<mvt:elseif expr="(g.screen EQ 'OSEL')">
<body onLoad="javascript:urchinTracker('/funnel_G1/shipping.html')">
<mvt:elseif expr="(g.screen EQ 'OPAY')">
<body onLoad="javascript:urchinTracker('/funnel_G1/payment.html')">
<mvt:elseif expr="(g.screen EQ 'INVC')">
<body onLoad="javascript:urchinTracker('/funnel_G1/checkout.html');__utmSetTrans()">
<mvt:else>
<body >
</mvt:if>
If you are using Miva 4 with OUI use the following code:
%OUI%
%IF(g.screen EQ 'OINF')%
onLoad="javascript:urchinTracker('/funnel_G1/address.html')"
%IFEND%
%IF(g.screen EQ 'OSEL')%
onLoad="javascript:urchinTracker('/funnel_G1/shipping.html')"
%IFEND%
%IF(g.screen EQ 'OPAY')%
onLoad="javascript:urchinTracker('/funnel_G1/payment.html')"
%IFEND%
%IF(g.screen EQ 'INVC' and (NOT g.Data_Entry_Error))%
onLoad="javascript:urchinTracker('/funnel_G1/checkout.html');__utmSetTrans()"
%IFEND%
If you already have other data in your body tag then you will need to modify the code above to suit your needs.
Now each time someone enters the checkout process it will be tracked by Google Analytics. After a few days of gathering information, you should be able to use the funnel visualization tool to see exactly where your visitors are abandoning their carts.
Sources: I used the this thread from the Miva Forums to help create this tutorial.
About the Author: Brennan Heyde is an e-commerce consultant working in San Diego, Ca. He specializes in online marketing and SEO for e-commerce. Have a struggling e-commerce website? – Contact Brennan today for a site analysis.