Using Google Analytics with GWT

There are many ways to use google analytics with your GWT application. The simplest is just pasting the GA code into your index.html which was not enough for me because the different places in my application won’t get recognized. So I build another approach, which listens to PlaceChangeEvent’s and tracks it with GA. Here’s the code:

This example is easily usable with theĀ  GWT MVP design, just register an GoogleAnalytics instance to the simple event bus initalized with the ActivityManager: