Google Analytics on GooglePages
Google Analytics is an excellent free tool for tracking and analyzing website usage statistics. After filling-out a short sign-up form
, a GA account is added to either an existing or new Google account.
It is possible to add the GA tracking code to all GooglePages, including the default "home" page. GPX-Files uses both GA and StatCounter
for visitor tracking, because the two counters provide nicely complementary features: GA is great for long-term and in-depth traffic analysis, whereas StatCounter provides excellent real-time tracking information.
Adding "Urchin" Tracking Code
Google Analytics tracking code is known under its mischievous "urchin" moniker for legacy reasons. An example of the actual "urchin" JavaScript is shown below.
<script
src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
<script type="text/javascript">
_uacct = "UA-UserCode-ProfileCode";
urchinTracker();
</script>
To add this code to a GooglePage using Google Page Creator:
- read the Known JS Bugs
page for warnings and caveats about adding JS code to GooglePages - select an editable field (e.g., page footer)
- enter "Edit HTML" mode
- add the "urchin" script at the end of the existing HTML code
- add <DIV> and </DIV> wrappers before and after the "urchin" script
... existing HTML content of the editable field ...
<div><script
src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>
<script type="text/javascript">
_uacct = "UA-UserCode-ProfileCode";
urchinTracker();
</script></div>
- "Save Changes" and "Publish" the page
- the GooglePage is now ready for tracking by Google Analytics
NOTE: If the field becomes uneditable after the script has been added to it, consult the description of the uneditable field
bug for the detailed information and several work-around options.
Google Analytics Setup
The "urchin" tracking code must be added to each page that needs to be monitored by Google Analytics. The code is the same for every page, i.e., it contains no page-specific information because tracking of individual pages (by page titles) is done on the GA server side. GA setup and reporting works in the most logical fashion if the tracking code is added to the (main) home page of the site, therefore it is highly recommended to do so before proceeding with the GA setup. Make sure to read about known JS bugs
, however, before adding the GA or any other JS code to the default "home" page.
The following GA profile settings work for GooglePages sites:
- Website URL: username.googlepages.com
- Default page: home
Once the GA profile setup is complete, selecting the "Check Status" option should display a message similar to the one shown below.
This completes setting up the Google Analytics tracking. The individual GooglePages will appear in GA reports with titles structured as follows:
GooglePages server automatically creates TITLE attributes for pages in the above format, so it is advisable to give each GooglePage a unique name. The GooglePage Name in this case refers to the text in the title field, rather than the filename (URL) under which the page is published.
Tracking Individual Links with Google Analytics
A very powerful and useful feature of Google Analytics code is the ability to track the use of individual links, even if those links point to external sites or to non-HTML files.
The procedure is described in a GA Help article
and involves simply adding the following code inside the <A HREF> element of the link that needs to be tracked:
onClick="javascript:urchinTracker ('/category/filename');"
where category and filename are, respectively, the two (or more) levels of labels under which the use of this particular link is to be reported. For example, the two "outgoing" links on this page both point to Google Analytics, so they are tracked as:
onClick="javascript:urchinTracker ('/outgoing/GoogleAnalytics');"




