Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Vaadin Google Analytics Tracker
Java JavaScript
Pull request Compare This branch is 4 commits ahead, 4 commits behind samie:universal.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Google Analytics Tracker extension for Vaadin 7

Google Analytics is a JavaScript based tracking service for websites. With this widget you can track any application events using a simple API. The Vaadin 7 version also supports Navigator API for automatic reporting.

Sample application

GoogleAnalyticsTracker class is used as an extension to Vaadin UI class. It can be also be bound to the Navigator to allow automatic tacking of View changes.

Full demo source code available here.

public class GoogleAnalyticsTrackerDemo extends UI {
    protected void init(VaadinRequest request) {

        // Create a tracker for domain.
        GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker(

        // attach the GA tracker to this UI

        // simple view navigator sample
        Navigator n = new Navigator(this, this);
        n.addView("", MainView.class);
        n.addView("second", SecondView.class);
        n.addView("third", ThirdView.class);

        // attach the tracker to the Navigator to automatically track all views
        // To use the tracker without the Navigator, just call the
        // tracker.trackPageview(pageId) separately when tracking is needed.

        // Alternatively you can use trackPageview
Something went wrong with that request. Please try again.