Firebase - log events from server side cloud functions [duplicate] - firebase

This question already has answers here:
Firebase analytics from remote REST API?
(3 answers)
Closed 4 years ago.
We've developed a mobile app using Firebase and we want to add analytics. We want to add to the analytics several system events that are triggered from existing cloud functions. I do not see any way to log an event from a cloud function and the only way I see is from the client side.
Is there a way we can log event from the server side ?

There is no server side logging for Analytics events. Analytics requires information available only on the client in order to construct an event, and backend code doesn't have access to that information. If you need to log something on the server for use with analytics, you would have to log to another destination, and then export it all (including events originating from Firebase) to BigQuery to match up later for querying.

Related

Firebase rules that supports only requests from my apps [duplicate]

This question already has answers here:
Locking down Firebase DB access to specific apps
(2 answers)
Closed 3 months ago.
I have two apps registered in Firebase, say App A and App B. I haven't setup any firebase authentication system but I want to allow requests only from App A and App B. I want to check if the request is coming from my apps and then only perform the actions. If the request is from somewhere else then just reject it.
I want to have this security for Cloud Firestore and Firebase Storage.
Currently, this feature isn't available, some of this will be rolling out in the near future using the new App Check: https://firebase.google.com/docs/app-check
At this time, App check only supports:
Realtime Database
Cloud Storage
Cloud Functions (callable functions)

Is there any way to call remote api endpoints based on firebase analytics events?

I am trying to figure out a way to call an SMS TEXT MESSAGE provider's API endpoint based on events raised from the frontend of my app. Is there any way I can send text messages to my users based on the events being raised from firebase?
Similarly, I would like to explore ways to send Emails using SendGrid's API to my users based on events.
You can trigger Cloud Functions based on Analytics conversion events. From the Cloud Functions code, you can do pretty much whatever you want.

What prevents clients from taking advantage of your Firebase apiKey in the client code? [duplicate]

This question already has answers here:
Is it safe to expose Firebase apiKey to the public?
(10 answers)
Should I hide firebase api keys into backend? Not due to data security but project cloning issue
(2 answers)
Closed 2 years ago.
I have been messing around with Firebase in a web app and realized there's something I don't understand.
In order for the JS code to send data to the Firebase servers, your apiKey has to be in the JS. But then that means your API key is public, and anyone using your website can inspect the code and just send arbitrary commands to Firebase on your behalf from the dev tools, or from any other site now that they have the API key.
I know I must be missing something, since this would make Firebase not useful. What is it I'm missing? What prevents users from sending arbitrary commands to Firebase with your ApiKey?

Firebase Analytics Server Side [duplicate]

This question already has answers here:
Firebase - log events from server side cloud functions [duplicate]
(1 answer)
Firebase analytics from remote REST API?
(3 answers)
Closed 2 years ago.
Firebase Client (JS) supports Firebase Analytics.
In there, I use the method logEvent to log my events to GA v2 and see great funnels.
However, some events, like database events, or HTTP requests coming from a 3rd party aren't tracked by the client, obviously, so we are looking at how to log events from the firebase admin SDK, or just via a Google Analytics API.
It, unfortunately, seems like the "google analytics measurement protocol" used in firebase analytics doesn't have an API. Official or not.
I am looking for a canonical response to know if it is or is not possible to log events (or page views) from the firebase admin SDK or generally using whatever API / library in Node.JS
An immediate solution was to try to use the firebase client SDK in Node, however from this page: https://firebase.google.com/docs/web/setup It seems like if I instantiate the firebase client SDK on a Node.js server, I cannot use the analytics feature.
Edit:
While there are other similar questions, they are over a year old, and the responses might not be valid anymore.
Firebase analytics log events with cloud functions
Can I track my Firebase function in Google Analytics?
Firebase - log events from server side cloud functions
Firebase analytics from remote REST API?

Can bigquery or Firebase analytics data acessible from ios app side programmatically?

I have Firebase analytics data and enabled BigQuery. But I have a requirement to validate the number of events and screens at app side under automated UI testing. Anyway to access and validate the Firebase analytics data at ios app side programmatically either in swift or objective c?
There is no API to retrieve Google Analytics data through Firebase. See Can I get firebase analytics data using query?
There is also no API for BigQuery to allow secure access directly from your client-side app. That would be a significant security risk, as you'd be exposing data about all of your users to all of your users.
The usual way to implement functionality is to create a custom endpoint (either using a server you already have, or Cloud Functions for Firebase) that exposes just the information your clients need access

Resources