SKIP navigation
Buildit
Buildit

This page's main content:

buildit documentation

analytics.intermediate topic

Many template users have wondered about the possibilty of tracking usage of their web pages. We have been testing Google Analytics (GA) http://www.google.com/analytics/. It has worked quite well in our tests - so well, in fact, that we're now using it for several sites we maintain - on this very page in fact! The GA package is powerful, yet simple to implement and use. Oh, and did we mention that it's free? If you're interested in such things, and hopefully you are, here's how you can incorporate GA.

First see if your template(s) (i.e. wta_00.dwt) is/are the latest codebase. Just look at one of your pages in the Dreamweaver design view. If there is an editable region after the '0x Footer' region at the very bottom called '0x Analytics' then you can skip all the way down to the 'Adding GA to the current template' section below. If your template does not have that editable region, keep reading in the following boxes . . .

Are you 'old' - or 'new'?:
old template

This is the 'old' template. It was used between 2004-06 - but some are still using it. Note that the easiest way to identify the 'old' template is by the red wordmark in the upper-left, and the grey background on the page. If this is what you're using you'll have to upgrade your template as described at this link. Then you can come back here and follow the instructions in the 'Updating the 'new' template' section below.

new template

This is the 'new' template. It was used between 2006-present. Note that the easiest way to identify the 'new' template is by the white wordmark in the upper-left, and the silvery background on the page. If this is what you're using you can proceed directly to the instructions in the 'Updating the 'new' template' section below.

Updating the 'new' template:
  1. Download the latest template(s) http://www.unomaha.edu/buildit/now/
  2. Place the downloaded Template(s) in your local site's 'Templates' folder.
  3. Place the /inc/goo.htm file from the download into your local site's /inc folder (you won't be needing any of the other files you got in the download). The template will use this file (once you edit it) to hold the code GA uses to track your site.
  4. Go to http://www.google.com/analytics/ and register as a user - if you already have a Google account, you can use that one. Follow the steps, and when you get to the page that gives you your code, copy that code and paste it into your /inc/goo.htm file (by default, the file is empty) and then put it up to the webserver (avalon).
  5. Now open up your template(s) (i.e. wta_00.dwt [in your 'Templates' folder]). Look for the <!-- TemplateBeginEditable name="0x Analytics" --> near the bottom of that page. Paste this code - <?php include("/web/yoursite/inc/goo.htm"); ?> right after that - change the 'yoursite' part to your directory name on avalon. Click 'Save'.
  6. Next, Dreamweaver menu >Modify>Template>Update Pages...
  7. Make sure you're choosing the site you want to update.
  8. Choose the template, then click the 'start' button.
  9. If you have updated more than one template, repeat steps 5, 6, and 7 for each.
  10. For each update the dialogue window's log will show which files have been updated. Put your updated files up to the webserver and within 24 hours you should begin seeing the results on your GA account.
Adding GA to the current template:
  1. Go to the last editable region of your template(s) file (i.e. wta_00.dwt) - it's empty by default. The region name will be something like '05_ANALYTICS' or 'something-else_ANALYTICS'.
  2. In that editable region paste the following code: <?php include(/web/yoursite/inc/goo.htm"); ?>
  3. Be sure to change the 'yoursite' part of the include path to the directory where your site resides on the webserver.
  4. Then just follow the instructions at http://www.google/analytics/ and paste the code that they give you (and nothing else) into your goo.htm file, save it, and put it. The code you get from Google will look something like this (don't use this code)
    <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    _uacct = "UA-xxxxxxx-1";
    urchinTracker();
    </script>