GoogleAnalyticsTracker
Track Vaadin application use with Google Analytics
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.
Vaadin version compatibility:
Add-on | Vaadin version |
---|---|
1.x | Vaadin 6.x |
2.x | Vaadin 7.x |
3.x | Vaadin 8.x |
4.x | Vaadin 10-23 |
5.x | Vaadin 24+ |
Notes
- Since version 4.1.0 (Vaadin 10) Uses GA4
- Since version 3.1.0 (Vaadin 8) Uses GA4
- Since version 2.1.0 (Vaadin 7) Universal Analytics (analytics.js) is the default.
- Since version 2.2.0 event and user-id tracking was added
- Since version 2.2.0 project structure changed
Sample code
// Create a tracker for vaadin.com domain. GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker("UA-658457-8", "vaadin.com"); // Add only one tracker per window. mainWindow.addComponent(tracker); // Track the page view tracker.trackPageview("/samplecode/googleanalytics");
package org.vaadin.googleanalytics.tracking; import com.vaadin.Application; import com.vaadin.ui.Label; import com.vaadin.ui.Window; public class GoogleanAlyticsSampleApplication extends Application { private static final long serialVersionUID = 1L; @Override public void init() { Window mainWindow = new Window( "GoogleanAlyticsWidget Sample Application"); // A meaningless Label just to add some content Label label = new Label("Hello Vaadin user"); mainWindow.addComponent(label); // Create a tracker for vaadin.com domain. GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker("UA-658457-8", "vaadin.com"); // Add only one tracker per window. mainWindow.addComponent(tracker); // Track the page view tracker.trackPageview("/samplecode/googleanalytics"); // Assign main window setMainWindow(mainWindow); } }
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Universal Analytics support for Vaadin 6.
- Released
- 2014-05-30
- Maturity
- BETA
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 6.0+
- Vaadin 24+ in 5.0.0
- Vaadin 23 in 4.1.0
- Vaadin 22 in 4.1.0
- Vaadin 21 in 4.1.0
- Vaadin 20 in 4.1.0
- Vaadin 19 in 4.1.0
- Vaadin 18 in 4.1.0
- Vaadin 17 in 4.1.0
- Vaadin 16 in 4.1.0
- Vaadin 15 in 4.1.0
- Vaadin 14 in 4.1.0
- Vaadin 13 in 4.1.0
- Vaadin 12 in 4.1.0
- Vaadin 11 in 4.1.0
- Vaadin 10 in 4.1.0
- Vaadin 8.0+ in 3.1.1
- Vaadin 7.1+ in 2.2.0
- Browser
- Browser Independent
GoogleAnalyticsTracker - Vaadin Add-on Directory
Track Vaadin application use with Google AnalyticsKo-fi.com
Issue Tracker
View on GitHub
GoogleAnalyticsTracker version 1.1.2
Universal Analytics support for Vaadin 6.
GoogleAnalyticsTracker version 2.2.0
- Added event tracking. Special thanks to Ranil Wijeyratne.
- User ID support by Marc Jay
- Updated project layout to Maven Release plugin format
GoogleAnalyticsTracker version 3.0.0
Upgraded to Vaadin 8.
GoogleAnalyticsTracker version 4.1.0
4.1.x is upgraded to Google Analytics 4 (GA4) for Vaadin 10+.
GoogleAnalyticsTracker version 5.0.0
Vaadin 24 compatible version.
GoogleAnalyticsTracker version 3.1.1
3.1 is GA4 compatible version for Vaadin 8.
This is just new build with newer Maven plugins.