I made some code cleaning and packaging with the Google Analytics integration from the Sampler. This was made using the “new component packaging method” of Vaadin 6.2.
So, if you are already using the upcoming 6.2 series Eclipse plugin and Vaadin nightly builds just copy vaadin-ga.jar (link below) to your WEB-INF/lib and just let the plugin recompile. Done.
(The 6.2 makes it really easy distribute and install new components for Vaadin. And I really like it. )
And the component is also easy to use. Here is a usage sample for the widget:
GoogleAnalytics tracker = new GoogleAnalytics("UA-xxxxxx-x", "somedomain.com");
root.addComponent(tracker);
tracker.trackPageview("/mypage");
[i]
(Just change the tracking code and domain above. You find them from Google Analytics control panel.)
The ga.js is loaded according to firebug (and chrome developer tools) but no request to __utm.gif is made.
Here’s my code (copy-pasted from the example):
GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker("UA-XXXXXXXX-X", "xxxxx.com");
addComponent(tracker);
tracker.trackPageview("/xxxx/Main");
I have the same issue:
The GA script loads fine. I can even see an UIDL being sent containing all the parameters, but nothing happens.
I tried debugging this via the GWT development tools, but my computer can’t seem to handle that (I got the impression it tries to load the entirety of Vaadin for debugging)
Can any one give some pointers on what to try next?
It took me a while, but I figured it out. The Google Analytics code is pretty picky about the domain you enter. If you’re not running on that domain, it will not send out a measurement. For instance, if you’re debugging locally.
I’ve now added some extra code that will send “none” as domain when running locally. This solved the problem.
Hello again, unfortunately Chrome will flag the site as insecure when the plugin loads the insecure version of ga.js. I notice that vaadin.com runs on https and uses ga.js. I would be very happy if someone could point me to how to change the plugin to work with https.
When I try to compile the widgetset I set the following log during the compilation.
[INFO]
[WARN]
Widget class org.vaadin.googleanalytics.tracking.client.ui.VGoogleAnalytics was not found. The component org.vaadin.googleanalytics.tracking.GoogleAnalyticsTracker will not be included in the widgetset.
When I try to compile this widgetset I get the following log during the compilation.
[INFO]
[WARN]
Widget class org.vaadin.googleanalytics.tracking.client.ui.VGoogleAnalytics was not found. The component org.vaadin.googleanalytics.tracking.GoogleAnalyticsTracker will not be included in the widgetset.
I see some recent positive comments, but I can’t find anything in the svn that has a mod date after
<lp1:getlastmodified>Fri, 22 Jan 2010 09:42:28 GMT</lp1:getlastmodified>
Is this still actively maintained (granted it doesn’t look complicated, and comments seem to indicate that it still works although with what versions of vaadin is not clear from the comments).
It says 7 not supported… will that change anytime soon (does anything actually need to be done there). Currently I’m still on 6, but it would be nice to know if this solution is going to be able to move to 7.
Finally, there doesn’t seem to be any license for this library… Could whoever maintains this declare a license? Preferably something FOSS, and commercial-use friendly. Without a clearly defined license many folks can’t use this.
As far as I know, the license should be Apache 2.0 but Sami should confirm that.
Also as far as I know, there haven’t been such problems that would have required a new version.
Support for Root extensions (
#6690 , since Vaadin 7 alpha 3) together with some other alpha 3 functions should make implementing this functionality for Vaadin 7 very simple.