Android Google Analytics

Source: Internet
Author: User

The project integrate GA and encountered some problems:

1. Too many hits sent Too quickly, rate limiting invoked

The problem is that sending hit (Event/screen) is too frequent to exceed Google's limits. The workaround is to set the session timeout to a suitable value, and the segment is sent uniformly to hit.

2. Google Play Services version compatibility issues

Because the Google Play Services version of the device is too old, you have to use an older version of Google Play services for compatibility.

' com.google.android.gms:play-services-base:6.5.87 '

This version comes with the GA package, but the package does not contain Analyticsreceiver and analyticsservice.

3. Statistical data loss after network disconnection

There has been a period of disconnection and then data loss after network recovery. Not only the data during the disconnection is not, and the data after the network recovery is no longer sent.

I changed some of the parameters of the Googleanalytics tracker, but I haven't started to test which of the settings have worked, and that's something to add.

Note the following is the Kotlin code

Analytics.setlocaldispatchperiod (Resources.getinteger (r.integer.ga_dispatchperiod))if(buildconfig.debug) {Analytics.logger.logLevel=Com.google.android.gms.analytics.Logger.LogLevel.VERBOSE//Analytics.setdryrun (True)} tracker=Analytics.newtracker (applicationContext.resources.getString (R.string.ga_trackingid)) Tracker.setsessiontimeout (60) tracker.enableexceptionreporting (true) tracker.enableadvertisingidcollection (true) tracker.enableautoactivitytracking (true)

It should be the role of localdispatchperiod, but it will not be known until after testing.

Of course this problem may be due to the Googleanalytics version issue. Google Play Services needs to be updated. Maybe if I use the latest version this problem won't appear, I haven't tested it yet.

Android Google Analytics

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.