Git Product home page Git Product logo

vaadin-ga-tracker's Introduction

Published on Vaadin  Directory Stars on Vaadin Directory Latest version

Google analytics tracking integration for Vaadin 24+

Sources for other Vaadin versions are in their own branches:

Track your Vaadin application usage using Google Analytics.

Download release

Official releases of this add-on are available at Vaadin Directory. For Maven instructions, download and reviews, go to https://vaadin.com/directory/component/googleanalyticstracker

Building and running demo

git clone https://github.com/samie/vaadin-ga-tracker.git
cd vaadin-ga-tracker
mvn clean install
cd demo
mvn jetty:run

To see the demo, navigate to http://localhost:8080/

vaadin-ga-tracker's People

Contributors

artur- avatar binbalenci avatar jcgueriaud1 avatar legioth avatar pmelici avatar samie avatar stravag avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vaadin-ga-tracker's Issues

Only working on page refresh

Hi, I have managed to get some data sent back to Google Analytics but that only seems to be when a page is refreshed. I have added a GoogleAnalyticsTracker.getCurrent().sendEvent() to a afterNavigationEvent(). The page view would already get picked up with a page refresh anyway but the event is only sent back once I refresh the page and not when I navigate normally. This is weird as the method is called when I navigate to the page without a refresh. Is getCurrent() not likely to work without a refresh?

sample code for Events tracking mentions Universal Tracking API but gives no explanation

        // Use this if you still haven't upgraded to Universal tracking API
        // tracker.setUniversalTracking(false);

is this "universal api" something that users of this JAR dependency need to configure somewhere? in their Google Analytics Accounts? in their web.xml? somewhere else?
my impression was that the library (JAR file) itself manages what js file is used to track pages or events.
maybe it makes sense to mention that in the file.

UPDATE:
I found that my events were not shown in GoogleAnalytics because of a filter I had. pilot error :)
feel free to close this issue.

awesome plugin!

Not able to get all the required classes.

When i added maven dependencies as ::

org.vaadin.addons
googleanalyticstracker
3.0.0

then also i am getting error in my application for the @IgnorePageView, @EnableGoogleAnalytics(value = "UA-658457-8") and GoogleAnalyticsTracker.getCurrent(), as the classes are not available..

Please help me to find the proper solution.

dynamic value

Hello, first of all thanks for the plugin butI have some problems on version14.
The project will be used in different sites so
@enablegoogleanalytics(value = "xxxxyyyy")
I was unable to put this annotation value from outside(inject). I am having trouble because everyone's google analytics value is different. So is there anyway to make it dynamic?
Do you have any suggestions?

gtag

Are there any plans to switch to use of gtag? Reason being, this plugin doesn't seem to work with G-measurement Id's and Google suppor tfor universal id's is being removed in 2023.

Vaadin 23 and GA4

Should this addon work with Vaadin 23 and GA4?

I can't find the tracking ID in the browser developer console.

version 2.2.0 cannot be used according to its "download/Maven" instructions: `googleanalyticstracker-addon` is not found

this file
http://maven.vaadin.com/vaadin-addons/org/vaadin/addons/googleanalyticstracker/2.2.0/googleanalyticstracker-2.2.0.pom

refers to parent googleanalyticstracker-addon which cannot be found in the repo suggested by Maven instructions page for the plugin.

gradle script:


  repositories {
        maven {
            url 'http://maven.vaadin.com/vaadin-addons'
        }
        // ... other repos here
    }
    compile 'org.vaadin.addons:googleanalyticstracker:2.2.0'


Error:

  > Could not resolve org.vaadin.addons:googleanalyticstracker:2.2.0.
       > Could not parse POM http://maven.vaadin.com/vaadin-addons/org/vaadin/addons/googleanalyticstracker/2.2.0/googleanalyticstracker-2.2.0.pom
          > Could not find org.vaadin.addons:googleanalyticstracker-addon:2.2.0.
            Searched in the following locations:
                https://repo1.maven.org/maven2/org/vaadin/addons/googleanalyticstracker-addon/2.2.0/googleanalyticstracker-addon-2.2.0.pom
                https://repo1.maven.org/maven2/org/vaadin/addons/googleanalyticstracker-addon/2.2.0/googleanalyticstracker-addon-2.2.0.jar
                http://maven.vaadin.com/vaadin-addons/org/vaadin/addons/googleanalyticstracker-addon/2.2.0/googleanalyticstracker-addon-2.2.0.pom
                http://maven.vaadin.com/vaadin-addons/org/vaadin/addons/googleanalyticstracker-addon/2.2.0/googleanalyticstracker-addon-2.2.0.jar
                https://m2proxy.atlassian.com/repository/public/org/vaadin/addons/googleanalyticstracker-addon/2.2.0/googleanalyticstracker-addon-2.2.0.pom
                https://m2proxy.atlassian.com/repository/public/org/vaadin/addons/googleanalyticstracker-addon/2.2.0/googleanalyticstracker-addon-2.2.0.jar
                http://oss.sonatype.org/content/repositories/vaadin-snapshots/org/vaadin/addons/googleanalyticstracker-addon/2.2.0/googleanalyticstracker-addon-2.2.0.pom
                http://oss.sonatype.org/content/repositories/vaadin-snapshots/org/vaadin/addons/googleanalyticstracker-addon/2.2.0/googleanalyticstracker-addon-2.2.0.jar
                https://maven.vaadin.com/vaadin-prereleases/org/vaadin/addons/googleanalyticstracker-addon/2.2.0/googleanalyticstracker-addon-2.2.0.pom
                https://maven.vaadin.com/vaadin-prereleases/org/vaadin/addons/googleanalyticstracker-addon/2.2.0/googleanalyticstracker-addon-2.2.0.jar
                https://plugins.gradle.org/m2/org/vaadin/addons/googleanalyticstracker-addon/2.2.0/googleanalyticstracker-addon-2.2.0.pom
                https://plugins.gradle.org/m2/org/vaadin/addons/googleanalyticstracker-addon/2.2.0/googleanalyticstracker-addon-2.2.0.jar
    > Could not resolve org.vaadin.addons:googleanalyticstracker:2.2.0.
       > Could not parse POM http://maven.vaadin.com/vaadin-addons/org/vaadin/addons/googleanalyticstracker/2.2.0/googleanalyticstracker-2.2.0.pom
          > Could not find org.vaadin.addons:googleanalyticstracker-addon:2.2.0.



GoogleAnalyticsTracker is not serializable

Ditto.

An instance of GoogleAnalyticsTracker is added into the UI here:

GoogleAnalyticsTracker tracker = ComponentUtil.getData(ui, GoogleAnalyticsTracker.class);
if (tracker == null) {
tracker = new GoogleAnalyticsTracker(ui);
ComponentUtil.setData(ui, GoogleAnalyticsTracker.class, tracker);

removing the tracker when the view is closed

How to deattach/ remove the tracker, when the session/view is closed?
I am using googleAnalyticsTracker.remove();, but that doesnt seem to be working. I am having memory leak with this as the tracker object keeps getting accumulated

Broken on Vaadin 14.1.3

I used @EnableGoogleAnalytics with Vaadin 14.0.2 and it all works perfectly. I have now upgraded to Vaadin 14.1.3 and it no longer works at all. Nothing is sent back to Google Analytics and the Google Tag extension finds the tracker code but complains about a HTTP response. I don't 100% know what 14.1 would have released to break this. Any ideas what could have broken this?

Use of unsecure (http) vaadin-addons and vaadin-prerelease repositories

The addon still uses unsecure http repositories for vaadin-addons and vaadin-prerelease.
This happens due to the use of the Vaadin Platform (Bill of Materials) version 10.0.0 (see following screenshot).

Bildschirmfoto 2022-01-06 um 18 25 13

Since Maven 3.8.1 http repositories are blocked. So any project with this maven version or higher cannot build a project containing this addon (see following screenshot).

Bildschirmfoto 2022-01-06 um 17 08 58

Could you please release a newer version with updated dependencies?

Update Addon and Maven release

Hi,

if I download the actual Maven package there is no userId-constructor like you added within the latest changes one year ago. Could you please add a version to Maven and also update the Addon site at vaadin?
Also the event tracking from the PR would be nice to have..

Thank you

Replace executeJavascript with executeJs

executeJavascript (called by GoogleAnalyticsTracker) has been deprecated in Vaadin 14 and was removed in Vaadin 24.0.0.alpha10

This change would require a new major version of the add-on (or some reflection trick), since the latest one is compatible with Vaadin 10 to 23.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.