To use Google Analytics in GWT, we set up a couple methods like this: public static native void runGoogleAnalytics() /*-{ try { $wnd.gaTrack = $wnd._gat._getTracker("UA-XXXXXX-X"); $wnd.gaTrack._setDomainName(".slique.com"); $wnd.gaTrack._trackPageview(); } catch(err) {} }-*/; public static native void runGoogleAnalytics(String pageName) /*-{ try { $wnd.gaTrack._trackPageview(pageName); } catch(err) {} }-*/;
We call runGoogleAnalytics() in onModuleLoad, and then runGoogleAnalytics("/gwt/ministry/of/silly/walks") wherever we want to track a new page. I hear that GA "Events" are the right way to do this, but this has gotten us started. Note: the setDomainName call is only necessary for us because we use the same GA account to track all subdomains on our site. Does that help? ~Carver http://slique.com - builds group memory by putting all your group's email, files and documents in one place I'm not being curt, I'm just using http://five.sentenc.es/ On Jul 30, 11:25 am, makoki <iagoto...@gmail.com> wrote: > Yes, right, we're trying to track dynamic pages. Otherwise, as Juraj > says, we don't have any problem. > On 29 jul, 17:22, Juraj Vitko <juraj.vi...@gmail.com> wrote: > > > I have not implemented Analytics in GWT yet, but it seems that unless > > you want to track dynamic "pages" inside your GWT app, you may just > > include the urchin.js script plus the trigger scriptlet (possibly > > wrapped in try { } catch) in you host HTML page. > > > On Jul 28, 7:22 pm, makoki <iagoto...@gmail.com> wrote: > > > > We had recently discovered a bug in our application that came out to > > > be a problem with google analytics integration and liked to know if > > > someone had any idea for a better way to integrate GA with GWT. We've > > > been using GA in out GWT application for quite a time (nearly a year) > > > without a problem but today we discovered that there's a problem with > > > IE6 and GA when we browse the application through localhost or any > > > hostname that hasn't a complete domain (i.e. example.com) so browsing > > > our app throughhttp://localhost/myapporhttp://netbiosname/myapp > > > raises the problem otherwise the integration works seamlesly, if we > > > use the IP or the public domain. > > > We've been tracking down the problem until we found it was the > > > _trackEvent(c,v,d,b) method of GA that was causing the problem (we've > > > found it empirically :P) > > > We've used this explanation to integrate google > > > analyticshttp://code.google.com/p/gwt-examples/wiki/project_UrchinTracker > > > > The ga.js script we downloaded directly from google last november more > > > or less and we're currently using GWT 1.7.0 , all is working fine > > > except in the case explained above. > > > Any idea what's happening? Any alternative to integrate GA? > > > Thks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---