Installing and configuring Google Analytics

Chances are, before long, you will want to know how many people are visiting your shop. You may also want to know where they are finding links to your shop and where they are located geographically. CafePress does not provide and traffic statistics that I'm aware of to shop keepers. However, there are many JavaScript-based solutions for tracking visitors. The most impressive I've ever used is Coremetrics, however, it's exorbitantly expensive. Luckily, Google bought a web analytics company called Urchin awhile back, adapted Urchin's software to be purely web-based, and released it as a free service named Google Analytics.

Google Analytics is a powerful analytics package that is capable of showing you a great deal of information regarding your traffic. You'll find that you can't use some of the more advanced ecommerce features in Google Analytics because CafePress does not allow you to modify the checkout pages. Fortunately, even without these features, it's a fantastic tool.

  1. Sign Up

    If you don't already have a Google account, the first step is creating one. If you already use G-mail, Adwords, Upload Froogle Feeds, or use the Google Webmaster tools, then you can use your existing account by signing in from the Google Analytics Homepage.

  2. Add the tracking code

    After you sign up for Google Analytics, you will be given tracking code to place on your site. It will look like this:

    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-1234567-1"; urchinTracker(); </script>

    The only difference between the code that Google gives you and the code listed above is that it will contain your account number instead of 1234567-1. Place this code at the bottom of the Footer section of your Custom HTML. The code will pull some JavaScript onto your page from Google's servers. This code will tell the browser to make an extra request to Google. This request will tell Google all sorts of information about the visitor to your site including what browser they're using, what screen resolution they are running, what page they came from, and what their I.P. address is. Google collects this data and then creates detailed reports for you to view at your leisure.

  3. Exclude your I.P. Address

    You probably don't want to track your own visits to your shop. Regrettably, Google does not provide an opt-out function. They don't even exclude you from Analytics reports if you are actively logged into Google Analytics while browsing your shop. Chances are, your ISP Service Provider gives you a dynamic I.P. address that changes from time-to-time. If you are connecting to the Internet via dialup, this number probably changes almost every time you log in. If you are connecting via broadband over cable or DSL, it probably does not change very often.

    If your I.P. address doesn't change often, the simplest way to exclude yourself is to create a filter in Google Analytics. First you'll need your I.P. If you don't know how to find out what it is, you can check it by going to http://whatsmyip.org/. After you have your I.P. address, sign into Google Analytics and open the Filter Manager.

    1. Click "Add Filter"
    2. Name the filter whatever you'd like
    3. Choose "Exclude all traffic from an IP address" as the Filter Type
    4. Enter your address in the box labeled "IP address" but put backslashes (\) in front of the dots. For example, if your I.P. address is 123.45.67.8, you would enter "123\.45\.67\.8". This is because the filtering tools match using "regular expressions". In the regular expression syntax, periods have special meaning. Putting a backslash in front of the period cancels out that meaning.
    5. Move your website profile from the available side to the selected side by selecting it and clicking the button labeled "Add »"
    6. Click the finish button

    If your I.P. address does change frequently, you may want to take a different approach. If you misdirect the requests meant to go to Google Analytics somewhere else, your own machine for example, you will stop yourself from showing up in reports. The easiest way to do this is probably to edit your hosts file and place this line inside:

    127.0.0.1 www.google-analytics.com

    On computers running Windows, the hosts file is usually located at C:\windows\system32\drivers\etc\hosts. On most other computers (including Macintosh computers running the latest version of OSX), the file can be located at /etc/hosts.

  4. Create a conversion goal (optional)

    One thing you may want to experiment with is creating a conversion goal for reaching the shopping cart page. I've done this by using "http://www.cafepress.com/cp/viewcart.aspx" as the Goal URL. Using the reporting available from CafePress combined with Google Analytics, it may be possible to estimate the percentage of users who will complete checkout after viewing your shopping cart page. It may then be possible to estimate your conversion rate and average order size and use this information to set bid levels when paying for pay-per-click advertising. I'm still trying to flesh this out though. I can't yet say how effective it will be.

  5. Sit back and wait

    Usually, you should be able to view reports less than 24 hours after putting the tracking code on your site. I've seen it take as long as several days though.

Google Analytics