Ultimate Guide to Google Analytics Setup & Ecommerce Tracking

a) What can Google Analytics do?

  • Helps to track and generate detailed report on web site traffic, referral sources, search engines, referring keywords, duration of visit, entry and exit points and various other information that helps to analyze a website’s performance and take decisions for improvement.
  • E-commerce and ROI tracking – Google analytics can track visitor foot prints to generate reports on whether they are following the desired path of action, if there are specific points on the website where the visitors drop, it tracks advertisement campaigns and the traffic driven by each of them, it tracks sales and attributes them to their respective traffic source, equates the expenses for traffic acquisition and sales generated to calculate ROI.

b) How to Implement Google Analytics? (Just to track traffic details)

  • Sign Up for a Google Analytics Account or if you already have a Google account you can use that to log in to Google Analytics at http://www.google.com/analytics and then sign up for Analytics using the “Sign Up” button.
  • The sign up process would take ask for your website URL and other necessary info and you can move through the process by clicking on the “continue” button.
  • On the final step, you will be provided with a small piece of JavaScript that you will need to add to each page that you wish to track just before the tag. You can add this code as a Server Side Include or simply write it in your code.

    Example Code:




    The “xxxx-x” needs to be replaced by the Analytics account number for your website.

  • Once you have added this JavaScript to all your web pages click the “Check Status” button to ensure that the tracking code has been set properly.

c) How to set up Conversion goals for Google Analytics?

  • Log in to Analytics Account
  • Click on “Edit” option for “Settings” for the website for which you want to add the conversion Goals.
  • Google Analytics allows you to set up to four Conversion Goals. Against each of the Goals click on the “Edit” option on “Settings” tab
  • Enter the URL of your web page that you set as a Goal in the Goal URL field, add a name to the goal for ease of identification.
  • Click the radio button below to activate/deactivate the goal (by default it is active)
  • Set up a Funnel for your goal from the “Define Funnel” section (optional – explained in point below)
  • Set up a Goal Value from the “Additional Settings” section. (Optional)

d) How to set up a Funnel for Goals?

  • You can lay down the expected path that a visitor would follow to reach the goal. This funnels help to identify if there is a glitch or an usability issue at any point in your website that is preventing the visitors to reach the goal.
    • Get to the Goal Settings page (Click “Edit” on settings tab for respective Goals)
      • Under the section “Define Funnel Option”, put in the URLs that you expect your visitors to follow to reach that specific Goal.
        • For Example – If you have set up your order Form Page as a Goal. You can set up a Funnel for the Goals as Home Page > Product Page > Order Form (Goal)

        e) Why and how do you set up a Goal value?

        • A Goal value needs to be set up if you need to measure the ROI for your marketing campaign. The Analytics program uses this Goal value to equate against the cost of traffic acquisition to calculate the ROI.
          • Under the “Additional Settings” section on the Goal Settings page you can insert a Goal value for each of the goals.
            • This option allows you to add a fixed amount as the Goal value and is effective only when all your sales are of the exact same value, else, it just provides an approx estimation of the value that you earn when a visitor reaches the Goal. For better tracking and calculation of ROI for E-Commerce websites, E-commerce tracking needs to be set up.

            f) How to set up Google Analytics for E Commerce?

            • Do NOT insert any Goal value for your goals on the Goal Settings page.
              • To enable e-commerce tracking you will need to indicate your website as an e-commerce website by clicking on the radio button for e-commerce website in Site profile. You can do this by clicking on “Edit” next to the site profile for which you would like to enable e-commerce.
                • Insert the tracking code in the receipt page in the standard fashion (explained in point (b) above.
                  • Somewhere below the tracking code you will need to insert the code for e-commerce tracking, which is as follows





                    Everything that are within the [] has to be replaced by actual values by your engine. A reference to the Parameters used in the above code can be found at https://www.google.com/support/analytics/bin/answer.py?answer=27203

                    The final output would actually look something similar to

                    UTM:T34535Main Store111108.068467.0610.00San DiegoCAUSA
                    UTM:I34535XF-1024Urchin T-ShirtShirts11399.009
                    UTM:I34535CU-3424Urchin Drink HolderAccessories20.002

                    For every transaction there will be one Transaction line that is indicated by the “T” after UTM – this line contains the total for the transaction including taxes and other information. The lines with an “I” after the UTM is the Item line and this contain the details of the items, their price and other details. There can be unlimited number of item lines for any transaction. An Item line is generated for each of the items that are processed during the transaction.

                    Note: The square brackets should not be included while setting the values for the form. Also, do not use comma to separate thousand figures for any digit, any digit after comma would be dropped.

                    • The final step is to call the function “utmSetTrans” when the form gets submitted. This is important to record the e-commerce information. This can be done in two ways.

                      You can call the function on Body OnLoad as shown below



                      If you do not have access to the body tag then you can call it within a separate Script tag. You need to ENSURE that the function is called AFTER the form.

                    g) How to use Google Analytics to track my Google Adwords Data?

                    • Log into your Google Adwords account
                      • Click on the “Analytics” tab
                        • Click on the link “I already have a Google Analytics Account”
                          • If you are using the same Google Account ID for your Adwords and Analytics you will see the Analytics account in the dropdown. Select the analytics account profile.
                            • “Destination URL auto tagging” will remain check by default, you should leave it checked.
                              • Also keep the “Apply cost Data” option checked (checked by default).
                                • Click on Link Account.

                                h) How to use Google Analytics to track Ad Campaigns other than Adwords?

                                To ensure that you are able to track non-Adwords advertisement campaigns through Google Analytics you will need to tag the destination URL for those campaigns with suitable parameters so that Google Analytics can easily differentiate between each campaign and pick up the necessary information.

                                Google provides an extremely helpful URL builder that would relieve you from adding the tags manually. You don’t need to use all six fields in the URL builder to tag your campaigns, just use the ones that are necessary. You’ll usually only need to use Source, Medium, Name, and Term (for paid keywords).

                                Alert: A small percentage of websites do not allow arbitrary URL parameters and serve an error page when auto-tagging is turned on. Please consult with your Webmaster to find out if this is the case or turn on auto-tagging and do a test by simply clicking on your ad. If the link to your site works then you can use auto-tagging. If you are getting an error, you’ll need to turn auto-tagging off from your AdWords account. Then, ask your Webmaster to allow arbitrary URL parameters before turning it back on.

                                Reference: http://www.google.com/support/analytics/?hl=en_US

                                Read more on SEO at SEO Consultant India Blog

                                You might also like (related articles):

                                This article has 13 responses

                                • 16.04.2007 6:29 pm Reply

                                  I’m having a hard time following this — by “receipt page”, does this mean that the tracking code goes on the page after the person has already submitted their order, or on the page when the person is confirming their order and are about to submit?

                                  Do you have any examples of this done properly? They’d be much appreciated.

                                • 16.04.2007 6:40 pm Reply

                                  Receipt page refers to the page where the client arrives after the transaction is complete and gets the details of his transaction.

                                  When a visitor arrives at the receipt page that inidicates that he has completed the order and then only he gets to see the receipt.

                                  You will probably be able to capture all these data even on the order confirmation page ( because all these values are carried through to that page) but there you wont have the confirmed data because your visitor might leave the page without confirming the order.

                                  The specific answer to this is provided at http://www.google.com/support/analytics/bin/answer.py?answer=27203&topic=7282

                                • 29.08.2008 10:46 am Reply

                                  Hello Saptarshi,

                                  I have read u r SEO Guide PDF. Its so nice to new learning SEO,s.

                                  I am also new learning SEO.
                                  Thanks for your nice SEO articles.

                                  Regards,
                                  Vishal

                                • 29.08.2008 3:21 pm Reply

                                  Hello Saptarshi,

                                  Plz tell me, Why we are keeping Java script & CSS code in external file, why not in page coge????

                                  regards,
                                  Vishal P.

                                • 29.08.2008 4:02 pm Reply

                                  Hi Visal, from the two consecutive comments that you have posted it seems youe scond question is pertaining to the point I mentioned in the SEO Guide.

                                  We advise to move JS and CSS to external files because that reduces the amount of code from your page, making it lighter and easier for search engine spiders to reach your content.

                                • 09.09.2008 3:50 pm Reply

                                  Hi saptarshi,

                                  Thanks for clearing my doubt,

                                  Can you pls send me whole SEO process (Start to End) for new developed site & old site also.

                                  I want to know whole process.

                                  regards,
                                  Vishal

                                • 25.09.2008 8:05 am Reply

                                  Ecommerce is one word that has uncannily boosted the economies of all, the first world, the second world and the third world countries. Though the trend of buying and selling through the electronic media, predominantly through the net, is a trend that has seen the upswing in the developed countries, the technicalities involved with it like making an ecommerce solution, is something that the firms in the developed countries hire from the poorer countries, thus giving a boost to the latter’s economy. Unfortunately, the benefits yielded by fields like ecommerce are yet to reach the grass root levels especially in the third world countries. http://www.infysolutions.com

                                • 07.01.2009 11:52 am Reply

                                  If you are serious about a home-based business, then going online is the best way to showcase your services. Lets say you are good at baking cakes, all you need to do is get an ecommerce website, optimize and phew! Start getting orders. Today thousands of people are doing well and are earning living via an online based business. http://www.inyecommercesolution.com/

                                • 26.03.2009 3:48 pm Reply

                                  Hi,
                                  This is Sachin. From 10 months i am working as SEO Trainee in one of the reputed company in Mumbai.
                                  I have query regarding to the SEO that what is future scope of SEO? Shall i consider SEO as Future career?

                                • 26.03.2009 4:46 pm Reply

                                  @sachin,
                                  well I don’t see any reasons why you should be concerned about adopting SEO as your future career. Even in this slowdown, SEOs are mostly keeping busy and there are companies that are hiring SEOs as well. With more and more companies becomeing revenue focussed I think a good part of their budget would move from offline media to Digital media thereby increasing opportunities for SEOs.

                                • 21.01.2010 12:13 pm Reply

                                  Hello Sir,

                                  Nice information you providing for those who want to learn the subject, can you guide me i want to learn seo completely step by step any referral sites or guides or if you have any material can you mail me, one of my cousin is doing the job in mumbai but he is refusing to say to me i recently completely my graduate even i search for the institues i think no one is good in hyderabad giving that much subject. Luckly i got your blog by surfing and i read your comments also and i have some doubts while reading what is digital media and offline media how it is useful for seo. Can i make it my career seo?

                                  Regards,
                                  john

                                • 30.01.2012 5:55 am Reply

                                  Hello Sir,

                                  I went throughmany helpful blog http://seo-kolkata.blogspot.com/2007/04/ultimate-guide-to-google-analytics.html

                                  Instead of that I was not able to understand few things so I am droping you an email.

                                  Now we want to track our daily emailer,promos. So with the help of url builder I can build the url but I didnt understand where that url to be inserted. So that tracking can start.

                                  For this we want to create a new campaign and do the tracking from there. i saw the campaign option in traffic sources in analytics, but dont know how to add a new one. Please guide me.

                                • Anonymous
                                  30.01.2012 7:04 am Reply

                                  You don’t need to create a separate campaign for this. Once you have created the UTM tagged urls using the URL builder you can use them for the different links for your emailer ( or whatever other campaign you run) and the value you use for the UTM_campaign parameter will show up under your campaigns section in Google analytics once you start receiving traffic through the campaign. It is important you use a different and descriptive name as the value for UTM_campaign, so the reports you get in GA would be easily identifiable.

                                  I hope this helps with your question.