Giter Club home page Giter Club logo

Comments (13)

tuananhhnaptech avatar tuananhhnaptech commented on June 3, 2024

me too. Google analytics mobile app real time is very slow when use this plugin.

from google-analytics-plugin.

boynet avatar boynet commented on June 3, 2024

me too, is this fork active develop?

from google-analytics-plugin.

danwilson avatar danwilson commented on June 3, 2024

There are several reports of this. I'm still investigating, but currently it does not appear to be a problem with the plugin itself.

from google-analytics-plugin.

aliokan avatar aliokan commented on June 3, 2024

The same for me.
In the Phonegap GAPlugin, it's possible to define delay between upload values, in gaPlugin.init();

from google-analytics-plugin.

pchop2 avatar pchop2 commented on June 3, 2024

I don't know of this will contribute to the root cause, but I have, oddly, noticed that this plugin works great on iOS, but android is having a difficult time sending the hits out of the app. This is the console output I am getting repeatedly as I jump to different views:

01-27 15:58:13.912    4250-4529/com.example.app V/GAV3﹕ Thread[GAThread,5,main]: putHit called
01-27 15:58:13.922    4250-4529/com.example.app V/GAV3﹕ Thread[GAThread,5,main]: Sending hit to service   PATH: https:  PARAMS: v=1,  ul=en-us,  t=appview,  ht=1422392293925,  sr=1080x1920,  an=Example,  tid=UA-123456789-6,  aid=com.example.app,  cid=d1873b0c-1994-4497-9bdb-561b444535e7,  av=1.0.0,  _u=.r3oK-AL,  cd=651226 - Title of view,
01-27 15:58:13.932    4250-4332/com.example.app W/PluginManager﹕ THREAD WARNING: exec() call to UniversalAnalytics.trackView blocked the main thread for 20ms. Plugin should use CordovaInterface.getThreadPool().

This is what I get when I initiate the app:

01-27 15:49:02.344    4250-4529/com.example.app V/GAV3﹕ Thread[GAThread,5,main]: connecting to Analytics service
01-27 15:49:02.354    4250-4529/com.example.app V/GAV3﹕ Thread[GAThread,5,main]: connect: bindService returned true for Intent { act=com.google.android.gms.analytics.service.START cmp=com.google.android.gms/.analytics.service.AnalyticsService (has extras) }
01-27 15:49:02.354    4250-4529/com.example.app V/GAV3﹕ Thread[GAThread,5,main]: Loaded clientId
01-27 15:49:02.354    4250-4529/com.example.app I/GAV3﹕ Thread[GAThread,5,main]: No campaign data found.
01-27 15:49:02.354    4250-4529/com.example.app V/GAV3﹕ Thread[GAThread,5,main]: putHit called

Note: I did replace the domain name with 'example' in each log entry.

When I come back from a soda break, I sometimes see the results in my console (so I think it's either heavily delayed or network connectivity is pretty slow). Just my observations, though. There may be a chance it might be platform specific, too.

iOS does exhibit a success hit whenever Google receives the impressions:

GoogleAnalytics 3.07 -[GAIBatchingDispatcher didSendHits:] (GAIBatchingDispatcher.m:167): 1 hit(s) sent

Don't think the message is the same on both platforms, but I am not getting anything like that on the Android platform.

from google-analytics-plugin.

paishin avatar paishin commented on June 3, 2024

Did anyone find a solution to this, my app's analytics seem to be a hit or miss, cant be used reliably

from google-analytics-plugin.

adamjaffeback avatar adamjaffeback commented on June 3, 2024

Bump. +1 for slow Android.

from google-analytics-plugin.

TompiT avatar TompiT commented on June 3, 2024

I'm using the PlugIn v0.8.0 and I'm currently experiencing the same issue with Android (i.e. Real-Time doesn't work on GA). I can also confirm that it's working fine with iOS.

According to my investigation I did a small change on the PlugIn class UniversalAnalyticsPlugin.
I changed the method StartTracker by adding a call to reportActivityStart like this:

    private void startTracker(String id, CallbackContext callbackContext) {
        if (null != id && id.length() > 0) {
            tracker = GoogleAnalytics.getInstance(this.cordova.getActivity()).newTracker(id);
            callbackContext.success("tracker started");
            trackerStarted = true;
            GoogleAnalytics.getInstance(this.cordova.getActivity()).setLocalDispatchPeriod(30);
            GoogleAnalytics.getInstance(this).reportActivityStart(this);
        } else {
            callbackContext.error("tracker id is not valid");
        }
    }

By updating the project with this change the Real-Time is now working on GA.

from google-analytics-plugin.

gsoftsolutions avatar gsoftsolutions commented on June 3, 2024

Thanks TompiT. Couldn't get reportActivityStart to compile but it did lead me to the right place.

I changed the time period of the setLocalDispatchPeriod method to 1 minute instead of 30. It appears to store tracking in local storage and then dispatches it to GA every xx minutes. Not sure what happens if the app is closed before the time period expires, so if it was set to 30 minutes and I closed my app after 29 would the local storage be cleared and nothing sent to GA? Any how, changing it to 1 minute I get all the real time stats in GA.

https://developers.google.com/analytics/devguides/collection/android/v3/dispatch

from google-analytics-plugin.

haroondilshad avatar haroondilshad commented on June 3, 2024

Hey I'm getting W/CordovaPlugin(14449): Attempted to send a second callback for ID: UniversalAnalyticsXXXXXXXX for some reason everytime I leave and come back to the page being tracked. Any ideas?

from google-analytics-plugin.

joelmeijering avatar joelmeijering commented on June 3, 2024

@gobalistik Your fix worked for me, it caused my android events to show up in real-time reports.

Changing setLocalDispatchPeriod(30) to setLocalDispatchPeriod(1) in UniversalAnalyticsPlugin.java in method startTracker() did the trick.

from google-analytics-plugin.

albertleao avatar albertleao commented on June 3, 2024

Is this fix going to be put in the main plugin?

from google-analytics-plugin.

victorsosa avatar victorsosa commented on June 3, 2024

this was fixed

from google-analytics-plugin.

Related Issues (20)

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.