Android / Google AnalyticsSDK:如何使REAL TIME分析正常运行?

时间:2021-12-08 15:19:01

I installed the Google Analytics SDK in my app.

我在我的应用中安装了Google AnalyticsSDK。

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

我希望能够进行实时分析(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:

我可以关注“Init”事件,但实时统计数据(例如,使用我的应用程序的实际用户数量)不起作用,即使我已经使用可以在调度时启动我的跟踪器,而不是这样:

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

Do you know how to solve this issue ?

你知道如何解决这个问题吗?

Thanks !!

谢谢 !!

1 个解决方案

#1


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.

如果您希望它与实时Google Analytics配合使用,则应使用trackPageView。不幸的是,他们还没有为事件启用此功能,仅用于页面浏览。

#1


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.

如果您希望它与实时Google Analytics配合使用,则应使用trackPageView。不幸的是,他们还没有为事件启用此功能,仅用于页面浏览。