Google Analytics Gadget

howto setup Google Analytics Tracking on Googlepages

News

 

July 2006 Google Analytics is now compatible with Goooglepages.

June 2006 The gadget below does not fully work - it currently only tracks the use of the gadget itself! Due to the iframe, this method will  neverr work properly. Also, Google Analytics does not accept the gadget as a valid top page. The workaround below does fully work.

 

Problem

Google analytics and googlepages are not compatible. All javascript is stripped when added using the "Edit HTML" button.


Workaround

Have all your pages manually edited and uploaded. Then use the google gadget "url redirector" (you can find it in the standard gadgets - search for "redirect") to redirect your homepage to your manual homepage e.g. index.html .


This is how to add Google Analytics Tracking to Googlepages

 

You must already have

  • A Googlepage
  • A Google Analytics Account

..just checking!

HowTo

In Googlepages

  • First you must create and upload a manually edited webpage to your Googlepages (or use an existing one if you already have one). This is needed due to Google Analytics not accepting the gadget as a valid page containing the Urchin javascript code.
  • Any URL will do, but as example, you can use <username>.googlepages.com/index.html

In Analytics

  • "add a Website Profile" and set the base URL to the Googlepages page you have setup above.
  • Insert the javascript code in the webpage above
  • Note your Google Analytics (Urchin) ID

In Googlepages

 that's it!


Just for your info

Here's a gadget button. Add to Google This will not give you anything useful on your Personalised Homepage (!). I put it here just to show you that this is implemented as a standard Google Gadget. Maybe you'll find this a starting point for copying and modifying...

Roll your own

In case you feel the need to have complete control over your Gadget by hosting your own file. Here's a simpler gadget with hardcoded Google Analytics ID. You can copy and modify this - but don't forget to hardcode your Google Analytics ID: http://jrweare.googlepages.com/google-analytics-jrweare.xml

(Here's another fun button   Add to Google )

Remember that if you make changes, make sure you code your gadget in a secure and robust way http://www.google.com/apis/homepage/guide.html .

 

Johnathon Weare 20th July 2006

Google Analytics, Googlepages and the Google Analytics image shown above and included in the Gadget are all copyright Google.

© 2006 Johnny Weare