7

Since I switched to SDK v4 I notice this in LogCat :

W/GAV3﹕ Thread[main,5,main]: int configuration name not recognized: ga_dispatchPeriod W/GAV3﹕ Thread[main,5,main]: string configuration name not recognized: ga_appVersion

All the other parameters are good but those really seem to be ignored. Any ideas ?

Thanks.

Guillaume
  • 1,051
  • 1
  • 11
  • 15
  • 34
    The documentation for Google Analytics v4 for Android is the worst documentation I've ever seen from Google! – Atul Goyal Apr 11 '14 at 12:36
  • 1
    Hi Atul, apologies for the confusing documentation. I would love to hear how we can improve the documentation for the SDK. Would you mind detailing what you don't like? You can use my . [at] gmail.com to email me. – Avi Apr 11 '14 at 19:26
  • @Avi For what it is worth, one of the things that makes the documentation difficult to use is the search does not allow you to restrict results to one particular SDK version. For example: https://developers.google.com/search/results?q=ga_dispatchPeriod&p=%2Fanalytics returns results for v2, v1, v3, v4, and then v3 again (in Belgium). –  Jun 20 '14 at 19:39
  • 2
    @Avi: couldn't find your last name on your profile for the email. Anyways, here are some of the things I found confusing. Nowhere in the "Dev-guide" is any mention about the "global configuration" that you mention below in your answer. It's only when I go to API reference as linked by you, I became aware about the global config. ga_dryRun is also supposed to be in global config, but that works fine from the tracker config, strange? A good place to clarify which param is to be in which config may be [here](https://developers.google.com/analytics/devguides/collection/android/v4/parameters). – Atul Goyal Jul 30 '14 at 14:45
  • 2
    Moreover migrating to V4 was a huge pain in the a** with no clear migration guide available (like the previous migration guides). I really hope GA Android SDK is not in list of one of those Google projects which suddenly get abandoned. – Atul Goyal Jul 30 '14 at 14:45
  • I think I'm wrong about 'ga_dryRun' in what I said above. – Atul Goyal Aug 01 '14 at 11:07
  • @Avi Could you please specify in your documentation which properties goes in which tracker config? It is really confusing to set up tracking. I am new at developing android applications and documentation so far was wonderful, however at this point (analytics) it gets really confusing. – gorgi93 Sep 15 '14 at 09:33
  • I agree with @AtulGoyal the document is a huge pain in the ass. Please improve it! – cwhsu Oct 29 '14 at 03:27
  • answer of @avi is correct, But for more description see this answer http://stackoverflow.com/a/33873660/1908296 – ahmed hamdy Aug 15 '16 at 19:37

2 Answers2

9

Apologies for confusing setup. Are you specifying the ga_dispatchPeriod and ga_appVersion values in the global configuration? If not, can you move them to the global configuration? This link specifies how to setup global configuration.

Note that global configuration is different from tracker configuration which is documented here.

If this does not fix your issue, can you paste the complete xml file? and how you are setting it up?

Thanks!

Avi
  • 2,373
  • 17
  • 22
  • Thanks. I had to do two things to make it work. First I had to move it to global configuration. I really think it should be better explained in the documentation as this per tracker configuration is new. Second I had to remove the resource link I was using as the version number. Otherwise, I could see in Charles Proxy the hits sent with parameter av set to @string/appVersionNumer. Why aren't we allowed to use a resource here ? – Guillaume Apr 14 '14 at 22:43
  • 1
    @avi official document of google analytics v4 is really a pain in the axx. You see that you put the `Configuration Parameters` in https://developers.google.com/analytics/devguides/collection/android/v4/#next-steps , but you never mention any thing about `` in the SDK document. I have to read so many threads until then I realize that the parameter is for global config only. – cwhsu Oct 29 '14 at 03:16
  • You have related information here https://developer.android.com/reference/com/google/android/gms/analytics/Tracker.html https://developer.android.com/reference/com/google/android/gms/analytics/GoogleAnalytics.html. But why don't you leave something a hint or a link in the SDK guide? That would save us lots of time. Moreover, the ga_dispatchPeriod is so confusing. According to the document, it says `Frequency of automatic dispatch in seconds.`, but it actually does nothing if a device has play service. – cwhsu Oct 29 '14 at 03:20
  • `With the integration of the Google Analytics SDK into the Google Play Services SDK, you won't have to worry about dispatching and manual dispatch will be a no op on devices that support Google Play Services. Some devices don't have Google Play Services, and on those devices the manual dispatch call will work as you would expect. The drawback is that you won't see your traffic right away in the real time dashboard for those devices that support Google Play Services.` According to this thread https://groups.google.com/forum/#!topic/ga-mobile-app-analytics/quIG9JdzRYY – cwhsu Oct 29 '14 at 03:21
  • 1
    Oh come on, if this is the real case, you `MUST` tell us in the document so we don't think that there is a bug or something is configured incorrectly. In GA v3, the data is uploaded as soon as the configuration is correct. In GA v4, I have to wait so long that I think the code or config is wrong. Please tell us everything we need to know in the document!!! – cwhsu Oct 29 '14 at 03:24
  • The entire setup documented step by step here (much better than Google's documentation): http://qnatech.wordpress.com/2014/12/31/how-to-setup-google-analytics-for-android-apps/ – Jasper Dec 31 '14 at 06:33
  • Everything with GA looks deceivingly simple and surprisingly deep sh!t you fall into just after you setup everything as it is in the examples. 2 days blind guesswork and still no success! – WindRider Feb 05 '15 at 20:09
  • If I understand correctly, we can simply skip the ***global configuration*** altogether. We start the Tracker, and it uses app name and version as specified in **AndroidManifest.xml**. Am I missing something? – Alex Cohn May 27 '15 at 10:03
4

WoW Why is this so over engineered? I use a single xml file for both app tracking specific configs AND global configs and I just add that meta tag in the manifest to point to that single xml file like so

<meta-data android:name="com.google.android.gms.analytics.globalConfigResource"
            android:resource="@xml/app_global_tracker"/>

And in my code i just do Tracker t = analytics.newTracker(R.xml.app_tracker); and thats all

ThanosFisherman
  • 5,626
  • 12
  • 38
  • 63
  • 1
    And in your anlytics.newTracker you refer to app_tracker instead of app_global_tracker ? – Jasper Dec 30 '14 at 18:23
  • 1
    Actually you don't even need to add this code to your manifest anymore just create an xml file in res>xml>whatever.xml put all your analytic specific settings in there and point to it from your code Tracker t = analytics.newTracker(R.xml.whatever); – ThanosFisherman Dec 31 '14 at 02:17
  • That's how they do it in iosched 2104. There're 2 trackers - debug and release. I do it exactly like they do it and almost zero success. Why everything commercial-related from Google is such P.I.A. to setup! – WindRider Feb 05 '15 at 19:59
  • Thanks @ThanosF: this is the true source of the warnings that we saw. Our app tried to use the same XML file for tracker configuration and for global configuration, and the settings like `ga_appName` and `ga_appVersion` caused "not recognized" warnings. We removed the `` from **AndroidManifest.xml** and removed the offending lines from **res/xml/app_tracker.xml** file, and now we are warning-free! – Alex Cohn May 27 '15 at 10:01