Hagai L
Hagai L

Reputation: 1613

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.

Upvotes: 7

Views: 530

Answers (2)

Wajid
Wajid

Reputation: 2341

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.

Upvotes: 1

looptheloop88
looptheloop88

Reputation: 3810

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.

Upvotes: 1

Related Questions