1

I installed the Google Analytics SDK in my app.

I want to be able to have real time analytics (new feature proposed by Google).

My code:

tracker = GoogleAnalyticsTracker.getInstance();
// the tracker is started with a dispatch interval of 20 seconds.
tracker.startNewSession("UA-XXXXX", 20, theContext);
tracker.trackEvent("Init", theContext.getPackageName(),"NoLabel", 0);
tracker.dispatch();

I can follow the "Init" event but the real time stats (giving for example the actual number of users using my app) doesn't work, even if I took can to init my tracker with a dispatch time, and not like this:

tracker.startNewSession("UA-XXXX", theContext);

Do you know how to solve this issue ?

Thanks !!

toto_tata
  • 14,526
  • 27
  • 108
  • 198

1 Answers1

9

You should use trackPageView if you want it to work with real time Google Analytics. They haven't yet enabled this for events, only for page views, unfortunately.

Jan S.
  • 10,328
  • 3
  • 31
  • 36
  • Can you elaborate more about trackPageView, please? is it a method, a service, an object... ? – Josh Sep 09 '15 at 09:00