It’s been a while since we added features to Gwt-Platform and since Google I/O is finished, we felt that some feature needed to be dealt with. One of these is the ability to easily let any GWTP application be crawlable by a search engine crawler following Google’s guidelines. For a while now we had a basic implementation that was used by many of you to build your own solution. But speed issues and timing constraints made it impossible to use the same approach on AppEngine. Now with features like always on and warmup request we can offer something easy to install and responsive. For more information about how to make the crawler work, take a good look at this piece of documentation.
The second feature we worked on is the seamless integration of your presenter-based application with Google Analytics. This new feature will automatically track any navigation event and presenter change provided you add the following bindings to your gin module:
bind(GoogleAnalytics.class).to(GoogleAnalyticsImpl.class).in(Singleton.class); bindConstant().annotatedWith(GaAccount.class).to("UA-XXXXXXX-X"); bind(GoogleAnalyticsNavigationTracker.class).asEagerSingleton();
The first line let’s you bind the various google Analytics function to our implementation, this line can be avoided by installing the new default module that we introduce with GWTP 0.6. The second line is where you bind your Google Analytics account to this application and the last line is where the tracker is actually instanciated alongside your application. As you can see, these three little lines will take care of everything and you’ll even be able to go further by injecting the GoogleAnalytics interface wherever you need it, so you can easily track custom events right from your GWT code. For more information about GWTP integration with Google Analytics check out this documentation page.
These features are only available in trunk and 0.6-SNAPSHOT for now. However the official release of GWTP 0.6 is planned for very soon. Stay tuned!
Hi, have you had any luck using Google’s “In-Page Analytics” (part of their Analytics service) when you’ve loaded ga.js via your GWT object (as opposed to directly in the host html file) ?
I didn’t try that yet! Let me know if it works for you 😀
Turns out that Google Analytic’s “In-Page Analytics” looks for a Google hosted ga.js in the host file for that function to work. That’s a shame! I like having that external resource bundled with the GWT code. I’ll open a bug with Google. Thanks!