This should be totally simple but I can\'t get it working no matter what I try. I\'m trying to use Google Analytics with GWT application. From what I understood, there are t
This is just a guess, but you probably need to reference the host page (the one where the Google Analytics JS code has been included) via $wnd in the JSNI, like this:
public static native void recordAnalyticsHit(String pageName) /*-{
$wnd.pageTracker._trackPageview(pageName);
}-*/;
JSNI code (and in general, GWT code) is run in a iframe to keep the namespace clean, that's why you need the $wnd reference to the main window.