I have problem with Google Firebase
I use Firebase Analytics and I want to use user properities for sepatare group users on my app.
Now I´m triing
FirebaseAnalytics analytics = FirebaseAnalytics.getInstance(this.getApplicationContext());
analytics.setUserProperty("myGroup", "1");
and another user
FirebaseAnalytics analytics = FirebaseAnalytics.getInstance(this.getApplicationContext());
analytics.setUserProperty("myGroup", "2");
I don´t see on console Firebase Analytics. How I set user properities correctly? And than where I will see on console Firebase?
The Developer Guide mentions that you should first register the user property in the Analytics page of the Firebase console. You'll find a tab there entitled "User Properties". After you register "myGroup" there, start logging more events after setting "myGroup" in your app and you will be able to filter those event reports using "myGroup" after a few hours.
Actually, as from my experience using BigQuery as well with Firebase, I want to add some more depth information about it using the comment above:
Yes, as mentioned above, to see your User Properties you need to add them like mentioned above on your Firebase Console (for filtering, etc.).
However, not adding is doesn't mean that they are not collected. It's logging regardless, they are not available on Firebase Console until you add them. However, as raw data they're there. Not necessarily an information you needed but it's good to know the truth behind it. Firebase Console doesn't let you see the raw data so you won't see it but, mentioning that it's not logging wouldn't be true.
Related
I'm looking to improve and get better insights into the apps behaviour right before a crash. In the production we have a lot of Timber.d and Log.XX calls issued but it is not possible to currently see the full application's log-stack in Firebase Crashlytics section. We only see the stacktrace of the crash as well as all the custom Firebase events that have been called.
Can someone advise on any feasible methods of forcing the application to submit the full log-stack upon a crash such that it would also be visible in Firebase?
There is no way to post full log files to Crashlytics.
What you can do:
Log events with Analytics at key points in your app's flow, which will then also show up (as a sort of breadcrumb) in your Crashlytics views by adding custom keys.
Write custom log messages for key points in your code leading up to the crash.
Set a user ID for your app instance, and then write the log file to another cloud based storage location (like Cloud Storage, for which there's also a Firebase SDK) with that same user id, after the app is restarted.
I wish to monitor app behavior and debug application on different devices.
I am trying to select the best approach, Firebase analytics, crashlitics, Goole analytics etc...
The problem:
User report on some devices they see incorrect app behavior (Not crash). For example user reports button not working, I wish to check if the user actually clicked the button and what happened.
What I need:
I need to find that specific user (or phone) in the monitoring system mentioned above and check the logs I added (for example: firebaseAnalytics.logEvent...)
Solution questions
Can I find specific user or phone in firebaseAnalytics? What is the best approach to addressing my requirements?
You can use Firebase Analytics Event Logging & Set User Id.
With this feature, you can keep track of users' logs, later generate statistics in Firebase Analytics or Google Analytics, and track specific users if you wish.
check this links
Firebase Analytics Set User Id
Firebase Analytics Event Logging
And If you want check not you wanted situation, you can add a custom exception to firebase.
try like this code.
if(isExpectedSituation) {
// some your codes.
} else {
FirebaseCrashlytics.getInstance().recordException(YourCustomException());
}
I would like to implement google firestore in my app, to collect some basic data about what options of app users use the most and how. Since it is not a small task, before I do, I would like to know, is there a way to get some statistics from that database and filter categories (all categories will be provided by users) like country, type of OS, version of app, and search for specific user by his id/email?
I don't think Firestore will have the functionality of providing statistics about the app user. However, most of the details you mentioned can be tracked with Google Analytics for Firebase.
Additionally, it is also possible to create other Custom Events and log these events from your application, as mentioned in the Log events section of the documentation.
If you want to know what events are automatically logged, refer to the Automatically collected events page of the GA4 documentation.
I'm implementing firebase analytics and would like to see the events logged in the firebase console immediately. This should be possible in the debugview but it's not visible in my console.
What do I need to do in order to add the debugview?
Debugview as seen in firebase keynote
My firebase console
DebugView is currently only available to a limited set of developers. If will be made generally available soon (I don't have any details on the exact date though).
If you have been invited to join the early access program, but it isn't showing in the Console, reach out to Firebase support so we can help you troubleshoot.
If you haven't been invited to join that early access program, DebugView correctly won't show in your console. Hint: I highly recommend you read this blog post in that case.
Now Firebase Debug view is available .
You have to set your devices a prop using adb command .
If you are using emulator take care to have the latest version of play services .
Check out your GoogleService-Info.plist file if IS_ANALYTICS_ENABLED property is true.
Background
Google allows to perform app-invites and also track how well they improve your app installations:
https://www.youtube.com/watch?v=UfdCNYXMC9M
The problem
I made a simple app invite, and it seems people do use it, using this code:
public static Intent getAppInviteIntent(Context context) {
return new AppInviteInvitation.IntentBuilder(title,appName).setCustomImage(imageUri).setMessage(message).setCallToActionText(download).build();
}
startActivityForResult(getAppInviteIntent(this), GOOGLE_APP_INVITES_REQUEST_CODE);
This works, but in the Analytics webpage, I can't find a way to show the statistics of the app-invite, and that's even though they say it's automatic (here). Sadly, even what I've found seem quite old and they use deprecated functions.
What I've tried
I thought that maybe it's not quite automatic (because the tutorial has some extra code for the receiver part too, here), and that we might need to add some code, as this docs say :
When the user accepts an invitation and installs the app, getInvitation(GoogleApiClient, Activity, boolean) will update the invitation state to installed and return the invitation data in an intent accessed from AppInviteInvitationResult using getInvitationIntent()
Looking at Google's sample (here), I've noticed they created 2 activities. One is the main activity, which does have a call to "getInvitation" , and another is called "DeepLinkActivity" , and handles deep links (which is probably for extra data, like coupons).
I've also found some stackOverflow questions about the tracking (like here), but all I see is that people didn't succeed tracking yet.
The questions
What is the minimal code needed in order to track the invitations and how well they work, as shown on the video? What should be configured in Analytics page itself? I don't use deep linking currently, so I don't want to use it.
It seems that Google moved the app-invites feature to "firebase" gradle repositories. Is it a must-have? What are the advantages? We currently use the previous ones ("com.google.android.gms:play-services-appinvite:..." ). The dashboard of FireBase doesn't seem to include as much UI for analytics as Google Analytics. Not to mention of app-invites.
If the answer to #1 is that I need to use "getInvitationIntent", does it have to be on the main activity of the app ? Does it have to be in an activity at all (maybe broadcastReceiver?) ?
It seems it's possible to also invite to IOS too ( as shown here and here, using "setOtherPlatformsTargetApplication"). Is this correct? How does it work? What happens when an IOS user clicks the link? What should be put into the parameter of "clientId" and where do I get it from ?
Does G+ have app-invites? If so, does it also have analytics?
Great questions. I'll do my best to answer everything. Please ask if you need clarification.
Analytics tracking requires a tracking Id that you'll need to set using setGoogleAnalyticsTrackingId(String trackingId), which I don't see in your example. This tracking Id is then handed to the downstream events that record analytics tracking events for you:
When invitations are send (both email and sms).
When the invited user accepts the invitation by clicking on the invitation link or button.
When the developer calls getInvitation()
When the developer calls convertInvitation()
So, to answer your specific questions, here goes:
Just add your tracking ID to the builder as described above, and all the tracking events will be reported. No need for a deeplink, that's optional on invites.
Yes, appinvites api is copied to firebase while retaining the original. For now they are exactly the same. Future improvements will be in firebase, so migrate when you have time.
getInvitationIntent() is called on the result returned in the callback from getInvitation(), so the callback should be within an activity. Also, since you'll only expect an invitation immediately after launch, you really only need to check in the main activity and any activity that would be launched from intent filters that trigger on the deeplink. Sounds like you don't use deeplinks, so only the main activity. Generally you should call getInvitation() from all activities that may be directly launched from an invitation, this is how you determine if your app is launched from an invitation.
Yes, invites can go cross-platform in both directions, iOS -> android, and android -> iOS. You need to define both apps in the same project in console.developers.google.com, which is necessary to associate them. If there is more than one iOS app in the project, that api call is necessary to disambiguate the iOS app that is paired with the android app. The ClientID parameter is generated in the console when you create the OAuth Client Id using the pulldown menu from credentials section.
There isn't any separate G+ invites.
Answers:
The Firebase Dynamic Links on Android documentation explains how to view the analytics data shown directly in the Firebase console. The critical step is to follow the Firebase setup instructions, most importantly:
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
The Firebase analytics integration has been streamlined from the legacy integration that required a tracking Id. Now with Firebase only setup and a call to getInvitation() are needed. No additional code or tracking ids required. Remember it takes up to 24 hours to see the results in the console. However, you can see the messages being sent immediately which is a great indication that it's working. Just enable verbose logging as described in Analytics Log Events documentation.
The Firebase and android developer documentation for appinvites are identical.
Yes, you must call getInvitation() to get analytics tracking, and do the setup as described above.
The iOS and Android equivalence apps should be in the same project. Just move them to a single project in the Firebase console. You can just remove one from it's existing project and add it to the other to make a combined project. The change should be reflected instantly.