Firebase Analytics APP_OPEN on Android - android

I made an Android app and I have integrated some tools of Firebase, but when I include the Firebase Analytics in the event APP_OPEN Android Studio shows that "I need out bundle", but in the docs of Firebase the method I should not send bundle. How resolve this problem?

The Bundle parameter is nullable. You can pass null if you don't intend to pass any parameters along with the APP_OPEN event. Note that even if no parameters are suggested for APP_OPEN, you are free to log up to 25 parameters in case you have some context that you would like to capture with the event (for example, you could pass a parameter that indicates how much time has elapsed since the previous APP_OPEN event).

Related

Firebase Dynamic Links - Can't get Url in android after install app from play store

If I install the app when clicking the dynamic link. All of that information from dynamic should be still available when I open the app for the first time.How can I get that information? It is not working when I use this: getInitialLink() returns Promise<string|null>;
Since, you haven't mentioned - I'm assuming you are having problems with shorter urls, if that's the case try putting the longer url.
Or refer here on Simon's answer: When I use the long instead of short links, everything works perfectly fine.
On Android, you use the getInvitation() method to get data from the Dynamic Link:
AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, false).setResultCallback
(/* ... */);
Then, in the callback, you can get the data passed in the Dynamic Links link parameter by calling the getDeepLink() method:
Firebase Documentation - Use Case
For future reference or detailed answer on Firebase Dynamic Links
Behave just like normal Links
In cases where the application doesn’t require installation (say, if it’s already installed) then clicking the Dynamic Link will automatically open the link to the desired screen.
Dynamic Links have a very simple process flow:
The user begins by clicking the Dynamic Link
If the the needs of the Dynamic Link target are satisfied (this is, the application being installed) then the user is navigated to the target location
Otherwise, if the application requires install in order to navigate
to the Dynamic Link target, the the user is taken to the point of
install for the application. Once the application has been installed,
the user is navigated to the target location of the Dynamic Link
And if that wasn’t all, we can integrate Dynamic Links with Firebase Analytics to track the interaction with any links that we generate for our applications. But if we only require simple tracking, then we can use the automatic built-in analytics from the Dynamic Links panel within the Firebase Console where we can also obtain attribution and referrer information for interacted links with no extra effort required from our side.
What makes it different from Google Analytics?
One of the first things that came to my mind when I read about Firebase Analytics was, “What about my Google Analytics setup?”. So if you already have Google Analytics in place, then why would you make the switch to Firebase Analytics? Well, here’s a couple of differences between the two:
Audiences
We can use Firebase Analytics to create Audiences — these are groups of users that we can then interact with using other Firebase service such as Firebase Notifications and / or Firebase Remote Config.
Integration with other Firebase Services
An awesome thing with Firebase Analytics is that we can integrate other Firebase services with analytics. For example, creating an Audience of users who have experienced a crash reported through Firebase Crash Reporting.
Lower Method Count
The Google Analytics dependency on Android has a total count of 18,607 methods and has a total of 4kb used for dependancies. On the other hand, Firebase Core (for Analytics) has a method count of 15,130 and only 1kb used for dependancies.
Automatic Tracking
When we add the firebase core dependency, it will automatically begin tracking a collection of user engagement events and device information for us — this is useful if you’re looking to only collect the minimal data for your app.
Unlimited Reporting
For up to 500 events, Firebase Analytics provides us with unlimited reporting straight out of the box for free!
No Singleton Initialisation
When setting up Google Analytics on Android we are required to initialize a Singleton instance. Firebase Analytics are simply available by fetching the instance directly from where we wish to track data. This isn’t much effort obviously but just makes the setup flow slightly easier.
Single Console
All of the data for every Firebase service is available for a single console. That makes it both easier and quicker for us to navigate from checking the analytic stats for our app to viewing the latest crash reports.
It looks like this is a react-native-firebase open bug for android
For fix the only thing that is required to be changed in module code:
private boolean isInvitation(PendingDynamicLinkData pendingDynamicLinkData) {
return FirebaseAppInvite.getInvitation(pendingDynamicLinkData) != null;
}
to
private boolean isInvitation(PendingDynamicLinkData pendingDynamicLinkData) {
FirebaseAppInvite invite = FirebaseAppInvite.getInvitation(pendingDynamicLinkData);
if (invite != null && invite.getInvitationId() != null && !invite.getInvitationId().isEmpty()) {
return true;
}
return false;
}
Bug reference : https://github.com/invertase/react-native-firebase/issues/1273
Please Check Your Manifest file
open AndroidManifest.file => In your activity tag there is intent-filter tag put below line in that tag.
<data android:scheme="https" android:host="your.dynamic.link" />
<data android:scheme="http" android:host="your.dynamic.link" />
If already done then check this link for the full blog on the dynamic link with react native.
Link: http://blog.logicwind.com/react-native-dynamic-links-using-firebase/
I hope this will help. sorry for the typos.

Using Crashlytics to send custom reports?

Currently I can only send crash reports to Fabric Crashlytics and according to this documentation, I can attach custom messages and name-value pairs to crash reports using the following code:
Crashlytics.log("Error Passing Data for User: " + user.getId());
But this only gets triggered if a crash occurs and then this data will be attached to the report.
But is it possible to send a a custom report without waiting for a crash to trigger it? Pretty much using Fabric Crashlytics as an analytics service.
For example if I want to send a message to the dashboard saying a specific method could not be called or if certain data is missing. I am trying to use it for analytics purposes for the developers to track the internal process logs.
Thanks in advance
Fabric provides an analytics module called answers.
It let you track events inside your app.
There are some predefined events but its also possible to define
your own events with custom attributes like this:
Answers.getInstance().logCustom(
new CustomEvent("Error")
.putCustomAttribute("Error Passing Data for User", user.getId())
);
Tracked events are available nearly immediately and can be analyzed inside the webinterface of fabric.

How to Creating custom events for firebase analytics [duplicate]

I am completely new to Firebase analytics. I am trying to send an event which shows statistics about my API call.
endTime = System.currentTimeMillis() - startTime;
// [START event]
Bundle params = new Bundle();
params.putString(FirebaseConstants.PHONE_NUMBER, Utility.getPhone());
params.putLong(FirebaseConstants.DURATION, endTime);
FirebaseAnalytics
.getInstance(getContext())
.logEvent(FirebaseConstants.BALANCE_CHECK, params);
// [END event]
But I only see the name of the event, number of users and occurrence count. 24 hours have already passed and I don't see my custom properties. For reference, I want to see a phone number(Utility.getPhone()) and the time which API call takes(endtime). Maybe it is possible that it does not send anything because I created custom params in my FirebaseConstans class
[Update, May 2017]
As of May 2017, custom parameter reporting is now supported in Google Analytics for Firebase. Please refer to this help center article for more details.
your custom data and parameters will be available as soon as your audience reach 10 or more, that is a privacy restriction.
so just use it in your activity as:
FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
Bundle bundle = new Bundle();
bundle.putString("some_key", "some_value");
mFirebaseAnalytics.logEvent("some_name", bundle);
it will work (after some time (max 24 hrs) you can see some_name as event in your event view but some_key will be available when audience is 10 or more).
As of https://support.google.com/firebase/answer/7397304?hl=en&ref_topic=6317489, you need to register your parameters before they can be shown
When you first set up custom parameters, a data card for it will be added to your event detail report. However, it may take up to 24 hours for any data to appear.
According to documentation, you have to link with BigQuery to see custom parameters:
Custom parameters: Custom parameters are not represented directly in
your Analytics reports, but they can be used as filters in audience
definitions that can be applied to every report. Custom parameters are
also included in data exported to BigQuery if your app is linked to a
BigQuery project.
Source: https://firebase.google.com/docs/analytics/android/events#log_events
I have contacted firebase support and got response:
Looks like the params don't pre-populate automatically. When creating
your audience, you'll have to fill them in yourself.
The thing is, data will be populated only with events coming AFTER creating new audience, you won't get data collected until that moment, which is something I would expect to be the case...
Edit: from firebase support personel
Audiences are not retroactive, so you will indeed need to create them before data will be populated within them. Do note that existing data can still be looked at and queried if linked with BigQuery. Also keep in mind that most audiences will have a minimum threshold which needs to be met before reports are generated for them.
From https://firebase.google.com/docs/analytics/android/events#log_events
Custom parameters: Custom parameters are not represented directly in your Analytics reports, but they can be used as filters in audience definitions that can be applied to every report.

'FirebaseAnalytics.Param.SIGN_UP_METHOD' is failing to save the 'value' along with 'Event name` in the console

I'm using this code to analyse the sign_up method user is using:
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.SIGN_UP_METHOD, "sign_up_method");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SIGN_UP, bundle);
as soon as the user sign up, above given code is supposed to save the event in the Firebase console.
The problem is that the event is getting created but the there's nothing under the value column, i.e., sign_up_method is not getting shown.
Here's a snapshot from the console (event name: sign_up is there but in place of the sign_up_method, there is a -):
What's going wrong here?
Please let me know.
I asked the same question from the Firebase Support Team and they told me that
Unfortunately, not all parameters are represented directly in your
Analytics reports. It is only available on a subset of suggested
events. But they can be used as filters in Audience definitions for
every report. They are also included in data exported to BigQuery if
your app is linked to a BigQuery project.
So, either link your app to BigQuery or get satisfied with what Firebase has to provide.
Please check the Firebase Analytics docs for this. Looks like you are incorrectly setting the parameter as FirebaseAnalytics.Param.SIGN_UP_METHOD
It should be FirebaseAnalytics.Param.METHOD instead

Logging Firebase events in Android [duplicate]

I am completely new to Firebase analytics. I am trying to send an event which shows statistics about my API call.
endTime = System.currentTimeMillis() - startTime;
// [START event]
Bundle params = new Bundle();
params.putString(FirebaseConstants.PHONE_NUMBER, Utility.getPhone());
params.putLong(FirebaseConstants.DURATION, endTime);
FirebaseAnalytics
.getInstance(getContext())
.logEvent(FirebaseConstants.BALANCE_CHECK, params);
// [END event]
But I only see the name of the event, number of users and occurrence count. 24 hours have already passed and I don't see my custom properties. For reference, I want to see a phone number(Utility.getPhone()) and the time which API call takes(endtime). Maybe it is possible that it does not send anything because I created custom params in my FirebaseConstans class
[Update, May 2017]
As of May 2017, custom parameter reporting is now supported in Google Analytics for Firebase. Please refer to this help center article for more details.
your custom data and parameters will be available as soon as your audience reach 10 or more, that is a privacy restriction.
so just use it in your activity as:
FirebaseAnalytics mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
Bundle bundle = new Bundle();
bundle.putString("some_key", "some_value");
mFirebaseAnalytics.logEvent("some_name", bundle);
it will work (after some time (max 24 hrs) you can see some_name as event in your event view but some_key will be available when audience is 10 or more).
As of https://support.google.com/firebase/answer/7397304?hl=en&ref_topic=6317489, you need to register your parameters before they can be shown
When you first set up custom parameters, a data card for it will be added to your event detail report. However, it may take up to 24 hours for any data to appear.
According to documentation, you have to link with BigQuery to see custom parameters:
Custom parameters: Custom parameters are not represented directly in
your Analytics reports, but they can be used as filters in audience
definitions that can be applied to every report. Custom parameters are
also included in data exported to BigQuery if your app is linked to a
BigQuery project.
Source: https://firebase.google.com/docs/analytics/android/events#log_events
I have contacted firebase support and got response:
Looks like the params don't pre-populate automatically. When creating
your audience, you'll have to fill them in yourself.
The thing is, data will be populated only with events coming AFTER creating new audience, you won't get data collected until that moment, which is something I would expect to be the case...
Edit: from firebase support personel
Audiences are not retroactive, so you will indeed need to create them before data will be populated within them. Do note that existing data can still be looked at and queried if linked with BigQuery. Also keep in mind that most audiences will have a minimum threshold which needs to be met before reports are generated for them.
From https://firebase.google.com/docs/analytics/android/events#log_events
Custom parameters: Custom parameters are not represented directly in your Analytics reports, but they can be used as filters in audience definitions that can be applied to every report.

Categories

Resources