Logging Analytics events from functions - firebase

We have three mobile apps that connect to our firebase instance: a client facing app, and two admin/employee facing apps. We log a variety of events in each, but we have several categories of events that we'd like to log that are not client-facing or initiated, but we need to attribute to a user. For example, if a user places an order and their payment is denied, or if they place an order that our system automatically cancels for some reason. Is it possible to log these from a function? We know the user ID, so it would be easy for us to attribute the event to the correct user, but I don't see a way to do this from a function.

Firebase Analytics does not support direct logging of events from sources other than the mobile app. However, you can:
Export your Firebase data to BigQuery, making sure that your events have the ID of the user
Write backend code to log other events to another table in BigQuery, using the same ID
Write a query to join those tables on the common ID to get continuity among all those events
Essentially, you will need to corral all your data in BigQuery to make it possible to merge your data from both the frontend and backend.

Related

Saving statistics to Google Analytics

I'm relatively new to Google Analytics and would like to have some inputs.
So I have a web application that people can install to create a backup and can do restores as well. The application has an API where you can see the statistics of the app i.e. number of backups made, restores made, and the number of clusters connected to this application.
Now I want to send these stats to google analytics with an interval of 10 minutes. I was wondering if I can send the status to Event with a unique UUID as Event Category, the backup/restores, or nodes as Event Labels and the number as Event Actions.
Is this the right approach to using Google Analytics Events? Or is there a better way to do it in GA? My requirement is I have to do it in GA or should I use a different hit type.
Given that we are talking API's you intend to use the Measurement Protocol?
And the UUID refers to the unique user? if so, you should look at the uid https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#uid
As to using Events versus Hits, using hits is probably easier on the reporting.

Is it possible to get which user triggered an event in Firebase Console?

Im learning how to use the analytics tool of firebase, i have the following problem:
I'd like to get who triggered those events, how would i got about doing that?
Google Analytics for Firebase only collects anonymized data by default. The console doesn't give you the identity of users who trigger events.
If you want per-user information, you're going to have to write client code to set a user property with the identifying piece of data (for example, a user ID), then export Analytics data to BigQuery, and make queries from there.

Is there any ways to get data from Firebase Analytics Log Events in real time?

I'd like to make a dashboard with the data that I stored in Firebase Analytics Log Events.
The only way I can use the data is downloading CSV file from each event and move the useful data to my database one by one and customise them.
But I want to fetch the data of Firebase Events directly to my dashboard for real time data. Is it possible?
Firebase Events is belong to Firebase Analytics. Check here: https://firebase.google.com/docs/analytics/events?platform=android

Firebase Analytics: registering custom parameters in the console

I'm having trouble understanding what's the benefit of registering the custom parameters of a custom event in the Firebase Analytics console.
Is it for analyzing the data or for logging the data?
If I don't register the custom parameters, will the events still being logged successfully?
If I want to analyze the data in BigQuery, will I first have to register these parameters in the Firebase console?
If I'm using more custom parameters in my app than the "Global parameter reporting quota" of Firebase, then will these events still being logged? Or I might "lose" the data for these events?
I've read the documentation thoroughly but it's not clear how the custom parameters are being handled.
I will answer my questions since I now have a clearer picture:
TL;DR: If you want to analyze the custom parameters in the Firebase console, you first have to register them. If you want to analyze them in BigQuery, you don't have to register them, but you need to link your project to BigQuery before you start logging these events.
The events and custom parameters will be always being logged, regardless if you register the parameters in the Firebase console or not.
Yes, the events will be logged as well as the custom parameters, HOWEVER, in the Firebase console, you won't have access to the data of the custom parameters unless you register them. And currently there is a limit of 10 text parameters and 40 numeric parameters. So registering the parameters in the console will allow you to analyze these parameters in the Firebase console.
NO, BigQuery will have the data for all events and parameters even if you don't register the parameters in the Firebase console. HOWEVER you need to link your project to BigQuery (requires a payment plan), BEFORE you start logging the events in the app. BigQuery will have access to everything from the time you link the project and onwards.
Previous answers apply to this question as well.
Sources: https://stackoverflow.com/a/44501664/658323 (answered by a Google product manager) & https://stackoverflow.com/a/44808845/658323
Answer to your questions in same order:
Both logging and analysis. Firebase provide a fancy interface for custom parameters too with a graph and number of times they have been logged.
2.Yes
Yes and also export the data to Big Query.
Events would be logged but not the custom parameters if limits are exceeded. Check out the doc for parameters limits.

Using firebase to show all active page visitors on shopify site?

I am trying to see if its possible to use Firebase to show the number of active users in real time on my shopify site. I also want to show the active users on a single product page if thats possible.
I see the Firebase example code for Presence but it looks like this only works for logged in users. How do I or is it even possible to show the real time user count ignoring whether someone is logged in or not...similar to the real time google analytics count?
The Firebase presence samples (one, two, three) all rely on the Firebase onDisconnect() handling. This method allows you to specify write/delete actions that should happen to your Firebase data on the server, once it detects that the connection to a client has been lost.
A system like this can work fine with using Firebase Authentication, but you need some way to uniquely identify each user. This can be any sufficiently random identifier, or for example the uid generate by Firebase's anonymous authentication. Both serve the same goal: authentication without identifications. That last approach is somewhat similar to how many analytics services work: they give you a unique ID when they first see you and then track you by that ID.

Resources