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.

13
  • Do you add that user property in dashboard?
    – Dentor
    Commented Aug 3, 2016 at 6:05
  • @Dentor I did add that property to the dashboard. But it still doesn't show up in stats.
    – Rakesh
    Commented Aug 3, 2016 at 6: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
    – Bob Snyder
    Commented Aug 3, 2016 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 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
    Commented Aug 3, 2016 at 15:17
  • 1
    @dazza5000 it already been more than 12 hours and I have not seen that event on the Firebase console.
    – Rakesh
    Commented Aug 4, 2016 at 5:32

1 Answer 1

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.