Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Firebase Analytics inside our android SDK

We're building SDK for Android apps which hopefully be used inside many android apps.

We need analytics both for ourselves and for the companies who would implement our SDK.

Does it make sense to implement firebase analytics inside our SDK in order to achieve this requirements? (I know that it works with big query so I thought I might be able to gain lots of value from it.) Is it even possible? (because of the JSON needed for the hosting app)

If it does make sense, what I really need is a list of pros and cons for using it in this scenario.

like image 397
Hagai L Avatar asked Jul 29 '16 13:07

Hagai L


People also ask

Can you use Firebase with Android Studio?

Option 2: Add Firebase using the Firebase Assistant. The Firebase Assistant registers your app with a Firebase project and adds the necessary Firebase files, plugins, and dependencies to your Android project — all from within Android Studio!

Is Google Analytics an SDK?

Google Analytics helps you understand how people use your web, Apple, or Android app. The SDK automatically captures a number of events and user properties and also allows you to define your own custom events to measure the things that uniquely matter to your business.

Is Firebase good for Analytics?

Conclusion. Firebase Analytics is a fantastic platform to analyze the performance of a mobile application. Its advantages include out of the box integration to Firebase SDKs, ready to use reports, and real-time analyses. Pricing could not be better, and it's completely free and available under the Spark and Blaze plans ...


2 Answers

You can integrate Firebase Analytics within your app, then track who uses your SDK by logging a custom event and parameters or any other information that you need.

Note that custom parameters are not directly displayed in your Analytics reports, however you can link your app to BigQuery to see these data.

like image 181
looptheloop88 Avatar answered Nov 15 '22 10:11

looptheloop88


As of now, this is not possible.

There is an issue created for this on Github. https://github.com/firebase/firebase-android-sdk/issues/66

Initialize FirebaseApp without google-services.json

FirebaseOptions options = new FirebaseOptions.Builder()
                    .setApplicationId(applicationID) // Required for Analytics.
                    .setApiKey(apiKey) // Required for Auth.
                    .build();
FirebaseApp.initializeApp(context, options);

<provider
    android:name="com.google.firebase.provider.FirebaseInitProvider"
    android:authorities="${applicationId}.firebaseinitprovider"
    tools:node="remove"/>

But the replies says as below:

Google Analytics for Firebase (GA4F) doesn't support dynamic initialization. Our engineers are checking the possible solutions to support this. It's just that we still haven't found a definite timeline as to when (or if) this will be available. GA4F will not work without the google-services.json file (or Gradle on your end). Even though you can initialize the FirebaseApp dynamically through code, GA4F will not recognize this and will only result in the error message you are seeing. The scenario you are getting is only specific to Google Analytics for Firebase. However, you can still use other products like Firestore, Realtime Database, Storage even if you are not using Gradle plugin.

like image 28
Wajid Avatar answered Nov 15 '22 10:11

Wajid