简体   繁体   中英

Does Google Analytics affect performance in Android?

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.

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

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.

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)

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM