5

I am trying to integrate Firebase RemoteConfig and Analytics with my Android application. Remote configuration part is working but Analytics part is not working. Here is my build.gradle

   // Firebase configuration
   compile group:'com.google.firebase', name:'firebase-core', version: '9.4.0'
   compile group:'com.google.firebase', name:'firebase-config', version: '9.4.0'

   // Firebase analytics
   compile 'com.google.android.gms:play-services-analytics:9.4.0'

Here is my Activity code.

 FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(this);
      firebaseAnalytics.setUserId("5107611364");
      firebaseAnalytics.setUserProperty("custom_user_property", "custom_user_proerty_value");

      Bundle bundle = new Bundle();
      bundle.putString(FirebaseAnalytics.Param.ITEM_ID, "SomeID");
      bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, "SomeIDName");
      bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "IdType");
      firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);

I am trying to publish customer property as well as the event but both of them are not working. I have enabled adb logging and I can see that custom event and property are published. These do not appear on the Firebase Analytics console even after 24hrs. I don't know what is wrong.

Bob Snyder
  • 37,759
  • 6
  • 111
  • 158
Rakesh
  • 3,987
  • 10
  • 43
  • 68
  • Do you add that user property in dashboard? – Dentor Aug 03 '16 at 06:05
  • @Dentor I did add that property to the dashboard. But it still doesn't show up in stats. – Rakesh Aug 03 '16 at 06:06
  • Just a comment on your dependencies. I doubt this is causing the problem. Firebase Analytics is in the `firebase-core` library. You don't need to include `play-services-analytics`. Ref [Getting Started Guide](https://firebase.google.com/docs/analytics/android/start/) – Bob Snyder Aug 03 '16 at 14:02
  • 1
    I believe Getting-started documented is not updated correctly. In the document they mention that they are using 9.2.1 but in sample app which is present on [github](https://github.com/firebase/quickstart-android/blob/master/analytics/app/build.gradle#L29-L36) they are using 9.4.0 and they have not included the core library. I believe they have removed the core library and put the classes in analytics library. – Rakesh Aug 03 '16 at 15:17
  • Yes, I see your point and wasn't aware of that. Still, you are including `play-services-analytics`. Did you intend to include `firebase-analytics` as is done in the sample app? – Bob Snyder Aug 03 '16 at 15:48
  • @qbix My bad, I didn't realized that you are pointing to `play-services-analytics`. I have changed it to `firebase-analytics`. I am testing now hopefully it will appear after sometime. I will post the update here after few hours. – Rakesh Aug 03 '16 at 15:53
  • @qbix I didn't see any changes in the analytics log. Logs lines are looking exactly the same as it was before. – Rakesh Aug 03 '16 at 15:59
  • Do you have a recent version of Google Play Services installed on your device? I think others have seen similar problems when GPS was not installed or was an old version. – Bob Snyder Aug 03 '16 at 17:02
  • Sometimes it takes a couple of hours for the events to be registered in the firebase console. – dazza5000 Aug 03 '16 at 18:25
  • @qbix I have the latest version of google play but it still doesn't work. – Rakesh Aug 04 '16 at 05:32
  • 1
    @dazza5000 it already been more than 12 hours and I have not seen that event on the Firebase console. – Rakesh Aug 04 '16 at 05:32
  • Another guess: Maybe there is something wrong with your `google-services.json` file. In the `adb` log output, there are FA-SVC messages output when a bundle of event data is uploaded. The bundle params include `gmp_app_id`, `app_id`, and `firebase_instance_id`. Do the values of those params look right? – Bob Snyder Aug 04 '16 at 14:25
  • The [Google Services Gradle Plugin documentation](https://developers.google.com/android/guides/google-services-plugin) is helpful for understanding the contents and processing of `google-services.json`. – Bob Snyder Aug 04 '16 at 18:10

1 Answers1

7

@Rakesh - you are looking in the wrong location. You are supplying customID feilds, in your example you are supplying CONTENT_TYPE : IdType. You don't need a minimum of 10 users to see the data...if you only have 1 user that data will appear within 24 hours of that user using your app.

I will say this, initially finding your own custom IDs is not very straight forward...it took me a while to find it too.

The place to find that custom reported info is: Anaylytics - Events - once on this page, click on the actual CONTENT_TYPE you are wishing to track, in your example above, it would be idType Analytics -> Events

Then on the Content graph you will see your customIDs (ie: someID)...click on someID. In my case (and in my screenshots) my equivelant someIDs are "field, button & select" Events -> CONTENT_TYPE

and then you will see all the data related to the values (someIDName) you passed into someID. CONTENT_TYPE -> customIDs

Now, if idType is not appearing for you then that may because Firebase isn't allowing you to create your own CONTENT_TYPE, I am not certain if you can do that as I have not tried...and in that case you would need to use a predefined CONTENT_TYPE. I am not using a custom idType, I am using CONTENT_TYPE : select_content.

rolinger
  • 2,787
  • 1
  • 31
  • 53