What is it?
Google Analytics (abbreviated GA) is a free service from Google that collects traffic data about your site and its visitors which can be used to better improve your site. GA can track visitors from all referrers, including search engines, display advertising, pay-per-click networks, email marketing and digital collateral such as links within PDF documents.
The URI web template currently embeds in its footer tracking codes which is a hidden snippet of JavaScript that the user adds onto every page of their website. This code acts as a beacon, collecting visitor data and sending it back to Google data collection servers for processing. Using the traffic data Google Analytics provides, you can make informed editorial, navigational and page design decisions to boost your site’s traffic and effectiveness.
Getting started
Step 1: Register for an account with Google if you have not already.
Step 2: Sign up for Google Analytics.
Step 3: Add GA tracking code to your HTML pages.
- After you sign up for a GA account, you will be presented with “tracking code” that you can copy and paste onto your HTML pages before your closing </body> tag.
- A typical tracking code looks like this:
-
<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-584930-4"); pageTracker._setDomainName(".uri.edu"); pageTracker._trackPageview(); </script>
- Note: the text in bold for “UA-584930-4″ above is the account set up by the University.
- If you are using the URI template that already embeds GA tracking code from the University, you can add an additional account as below. It’s a common practice to add the code to the .dwt template file or a separate footer file so that can be used to track all your pages.
-
<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-584930-4"); pageTracker._trackPageview(); var pageTracker2 = _gat._getTracker("UA-3966663-1"); pageTracker2._trackPageview(); </script>
-
Note: you must replace the account name in bold text above with your own account.
Step 4: Check your web traffic data.
- Log on to Google Analytics at https://www.google.com/analytics/. If everything was done correctly, you should see “Waiting for Data” under Status. It should take a day for any results to show up since Google enters new data from your site every 24 hours.
- If you’re a blogger, just include the Google Analytics code into all your blogging software’s templates.
Once you set up by site using GA, you can check back as often as you need for various traffic data, some filtered by geography and others restricted to a specific subset of the site.