Google Analytics会影响Android的效果吗?

时间:2021-04-15 15:22:58

There is lots of Google Analytics track point in my android code, will it will affect the app's performance? I knew the GA is async, but there are hundreds of track points in my app, so not sure if I should add GA point more carefully in future.

我的Android代码中有很多Google Analytics跟踪点,它会影响应用的性能吗?我知道GA是异步的,但我的应用程序中有数百个跟踪点,所以不确定我是否应该在未来更加谨慎地添加GA点。

2 个解决方案

#1


Performance impact in this case would mainly depend on IO operations and not on how much tracking points are being added.

在这种情况下,性能影响主要取决于IO操作,而不取决于添加了多少跟踪点。

As the app collects GA data, that data is added to a queue and periodically dispatched to GA. Periodic dispatch may occur either when your app is running in foreground or background.

当应用程序收集GA数据时,该数据将添加到队列中并定期分派给GA。当您的应用程序在前台或后台运行时,可能会定期发送。

The default dispatch period is 30 minutes but you can provide your own interval in seconds by using "ga_dispatchPeriod" parameter in analytics.xml file, or by calling setDispatchPeriod(int dispatchPeriodInSeconds)

默认的调度周期为30分钟,但您可以通过在analytics.xml文件中使用“ga_dispatchPeriod”参数或通过调用setDispatchPeriod(int dispatchPeriodInSeconds)来提供您自己的间隔(以秒为单位)

e.g. 60 (in analytics.xml) GAServiceManager.getInstance().setDispatchPeriod(60); (in code)

例如60(在analytics.xml中)GAServiceManager.getInstance()。setDispatchPeriod(60); (在代码中)

#2


The Google analytics SDK sends HTTP Gets or posts (I cant remember which) to Google. It doesn't wait for a response from the server mainly because the server doesn't return much of one.

Google Analytics(分析)SDK向Google发送HTTP获取或帖子(我无法记住哪些内容)。它不等待来自服务器的响应主要是因为服务器没有返回很多。

It may require a tad more band width to send all these calls. I cant see it slowing your app down.

发送所有这些呼叫可能需要更多带宽。我看不到它减慢你的应用程序速度。

#1


Performance impact in this case would mainly depend on IO operations and not on how much tracking points are being added.

在这种情况下,性能影响主要取决于IO操作,而不取决于添加了多少跟踪点。

As the app collects GA data, that data is added to a queue and periodically dispatched to GA. Periodic dispatch may occur either when your app is running in foreground or background.

当应用程序收集GA数据时,该数据将添加到队列中并定期分派给GA。当您的应用程序在前台或后台运行时,可能会定期发送。

The default dispatch period is 30 minutes but you can provide your own interval in seconds by using "ga_dispatchPeriod" parameter in analytics.xml file, or by calling setDispatchPeriod(int dispatchPeriodInSeconds)

默认的调度周期为30分钟,但您可以通过在analytics.xml文件中使用“ga_dispatchPeriod”参数或通过调用setDispatchPeriod(int dispatchPeriodInSeconds)来提供您自己的间隔(以秒为单位)

e.g. 60 (in analytics.xml) GAServiceManager.getInstance().setDispatchPeriod(60); (in code)

例如60(在analytics.xml中)GAServiceManager.getInstance()。setDispatchPeriod(60); (在代码中)

#2


The Google analytics SDK sends HTTP Gets or posts (I cant remember which) to Google. It doesn't wait for a response from the server mainly because the server doesn't return much of one.

Google Analytics(分析)SDK向Google发送HTTP获取或帖子(我无法记住哪些内容)。它不等待来自服务器的响应主要是因为服务器没有返回很多。

It may require a tad more band width to send all these calls. I cant see it slowing your app down.

发送所有这些呼叫可能需要更多带宽。我看不到它减慢你的应用程序速度。