Google Setup

Steegle.com now offers two new services:
Hassle free setup with minimum of effort.

RSS Feed

If you wish to receive updates from steegle.com please subscribe to the
RSS Feed

Recent site activity

Websites‎ > ‎Google Sites How-tos‎ > ‎

Google Sites - Adding Google Analytics

posted 11 Aug 2008 03:14 by Stephen Hind   [ updated 4 Sep 2011 08:49 ]

There appears to be a bit of confusion about how to add Google Analytics to a Google Site (in fairness it's due to the way Google Sites have written the instructions), so I decided to write my own.

Before I start let me make one thing clear: you do not add the tracking code given Google Analytics, just the Tracking IDas Google Sites removes any <script></script> tags.


Instructions

  1. Go to Google Analytics and sign up for an account (if you have not already done so) and sign in.
  2. Once signed in use the Add Website Profile link at the bottom left of the page.
  3. Ensure that the Add a Profile for a new domain is chosen and now you have to enter the URL (web address) of the Google site, but be careful:
    • If you have made a Web Address mapping for your site, e.g. www.example.com, then enter that address - see Mapped Example screen shot (on the right).
    • If you have not mapped the Google Site to a web address enter sites.google.com/site/example (where example is your site's name) your full site's address - see Sites Example screen shot (on the right).
    • Now use the Finish button
  4. Once you've used the Finish button Google Analytics displays the Tracking code: you need to get the Tracking ID from this code on line 6 - example follows with the tracking code highlighted:
    <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-XXXXXXX-XX");
    pageTracker._trackPageview();
    </script>
  5. Now use the More Actions button then choose Manage Site and go to the General tab, tick the Statistics tick box and enter the Tracking ID (not your Google Analytics Account ID) in the Paste your Analytics Web Property ID here: text box.

After 24 hours you should start to receive data, but Google Analytics may display

Tracking Not Installed
 
Check Status

for a couple of days, but it will be working regardless of this warning.

Get Found in Google Search

Further Search Engine Optimization (SEO)

See my Google Sites adaptation of Google's SEO Guide for more advice on how to make your website more accessible to your visitors and search engines - Google Sites - SEO (Search Engine Optimization) Guide.

Screen Shots

Mapped Example


Sites Example


Manage Site - General - Enter Analytics Tracking ID

Google Sites - Manage Site - General - Enter Google Analytics Tracking ID
Click for larger image