It took me a while to find out how to do this, but it’s really simple.Implementing this means that you can track usage of your gadget, whether embedded in a web page, or in a Google doc.
- Add a new domain to your google analytics account. Just make one up – in my case I used roadmapper.com. It doesn’t need to exist, and you dont need to own it. It just needs to look like a real domain.
- Remember the UA-xxxxx-n code that Analytics generates for that domain.
- Think of an imaginary page address – this is what views will get recorded against in your analytics report. Again – it doesn’t need to exist.
- Inject this into your in your XML code
- And this in your XML
Require feature=”setprefs” /
Require feature=”com.google.gadgets.analytics” /
You are good to go. Shortly afterwards analytics will start reporting on accesses to you gadget, under the domain and page you settled on.