firebase / firebase-admin-java

Firebase Admin Java SDK
https://firebase.google.com/docs/admin/setup
Apache License 2.0
545 stars 269 forks source link

FR: Firebase Analytics Server Side #137

Open cemo opened 6 years ago

cemo commented 6 years ago

My Environment:

Please provide Firebase analytics Api for server side. We would like to give a decision right now and being limited on client side is unfortunately not acceptable.

hiranya911 commented 6 years ago

What features would you like to see in a server-side analytics API? Client SDKs primarily support logging analytics events. I don't think there's a use case to support that server-side.

cemo commented 6 years ago

I would like to use firebase analytics as a marketing automation tool. My primary purpose is forwarding all events in our system to firebase and using its audience feature.

I want to do this in server side because it has major advantages.

  1. Instead of implementing firebase in multiple client, I can implement in a single server and maintain it.
  2. Accuracy of data in client sides are usually problematic.

I believe that it has great potential in server side as well.

avishalom commented 6 years ago

Just to clarify, A user does something which you log on your server, you are looking for a way for the server to log the event as the user (would you be passing user specific event attributes? (e.g. user-agent)). is that it?

cemo commented 6 years ago

@avishalom the scenario you are describing is exactly valid. You can consider our server as an agent.

esprehn commented 6 years ago

We have the same problem in cloud functions. The cloud function reacts to the client doing something and needs to log an event to analytics on behalf of that user. We don't want to give the client access to the data necessary to log such an event though.

It's the same use cases and motivate: https://developers.google.com/analytics/devguides/collection/protocol/v1/

adam-hurwitz commented 6 years ago

This appears to be exactly what we need to send data from Firebase to BigQuery using Cloud Functions: From Firestore to BigQuery with Firebase Functions.

rromanchuk commented 6 years ago

@avishalom I'm not able to track revenue because it's not bound to any user action on the client, it's actually an event by the negation of an action. It's not bound by a specific schedule either (it's not subscription model). The only way i could sort of maybe kind of do this is with silent push notifications that trigger a Firebase event, but this error prone. The only thing i can think of is using user properties to track accumulating revenue which will at least provide some context.

nightrise commented 6 years ago

Any updates on this feature, or documentation on doing it ourselves (via REST API for example)? I'm rather surprised this isn't a use-case covered by the core library. In server-authoritative applications, there are many use-cases where analytics events are emitted by the server, and not available to the client. In order to have a complete data-set we need to be able to emit analytics events server-to-server.

namanyayg commented 6 years ago

Is there any solution here? Is there some way to use BigQuery perhaps?

dabramovici commented 6 years ago

Also interested in this. Any updates?

cemo commented 6 years ago

Please upvote issue as well

namanyayg commented 6 years ago

For what it's worth, I don't see this happening anytime soon. Google simply doesn't support server side analytics, firebase analytics is exclusively for apps.

Right now I've imported my data into bigquery and am working on adding server side integration with my bigquery table. With this, I should be able to use bq to query data and later use datastudio to display it. I found this video helpful: https://www.youtube.com/watch?v=Ki_F6VCOtXU

andvalsol commented 6 years ago

Is still there an option to add Firebase Analytics on the server side?

samdozor commented 5 years ago

I'll add in that a SaaS analytics product that doesn't support a server-to-server flow today is extremely rare. Google's own "measurement protocol" for Google Analytics is widely adopted. And of course players like Adobe, Amplitude and Mixpanel support it. The value and use-cases for server-side APIs are well enumerated over hundreds of other tools.

That being said - opening up a server-to-server flow is more complicated than just documenting an API - since you have to support all of the "interesting" things folks will use it for. Supporting server data means that customers will try to send in web data, and offline data, and OTT data, etc. How do you accurately link up client-side and server-side identity?

By way of a guess - perhaps Google is in the process of combining GA and Firebase Analytics (frankly the branding is already getting conflated - they're calling it "Google Analytics for Firebase" as of this writing...), in which case it makes sense to hold off on releasing a true server-to-server flow. More conspiratorially, maybe they're deliberately limiting the use-cases for Firebase such that it's basically unusable for the enterprise businesses, who absolutely need a server-to-server flow, but who already are paying for GA 360.

Only time will tell! Either they'll come up with a solution or, in my opinion, Firebase will be relegated as a 2nd-tier analytics offering.

ToddKerpelman commented 5 years ago

Hey, folks. I'll just chime in to say this is a feature request the Analytics team has certainly heard from customers, and it's something they're looking into, but as usual I can't share any specific plans or roadmap or anything.

Right now, probably your best option would be to import your analytics data from Google Analytics for Firebase into BigQuery and then combine that with any other data you might be generating server-side, kinda like what @namanyayg mentioned.

cemo commented 5 years ago

@ToddKerpelman This is great. I think that this API is already implemented for mobile devices. In order to send events by mobile devices there must be an API for this purpose. I feel that the API needs to be officially documented and publicly available for server side.

stari4ek commented 5 years ago

This is the only solution to implement subscription tracking since there is no automatic subscription tracking provided by firebase

lauri3new commented 5 years ago

Is there any update on this or a link to a custom solution? Ideally I want to be able to update user properties in firebase analytics from server side, so I can filter by them later when using other firebase services e.g. FCM

n-sviridenko commented 5 years ago

We also need this.

Energy0124 commented 5 years ago

There is an important use case for games with IAP as any client-side information is going to be unreliable. Having the event logged in server-side make it a bit more reliable.

n-sviridenko commented 5 years ago

Many things happen server-side (e.g. events happening when the user is offline). Without such a simple feature, it's impossible to target the right users. This fact forces us think towards other solutions on the market :(

copilots-app commented 5 years ago

This is crucial for our solution as well. Please consider a fix ;-)

puf commented 5 years ago

It is now possible to add an Analytics label to messages. Does that mean this FR can now be implemented?

cemo commented 5 years ago

@ToddKerpelman, Is there any update on this?

voxelbustersold commented 5 years ago

It is now possible to add an Analytics label to messages. Does that mean this FR can now be implemented?

Looks like it has some limitations. Do you recommend for general logging from Firebase functions?

mmilowski commented 5 years ago

@ToddKerpelman I consulting Firebase analytics with the clients and its common problem :/ I was thinking about solution and maybe create few standard events (or it will be a new type of standard events) which can have permission to connect with server-side. Two cases that I have in my mind are 1. mobile app with subscription model

  1. mobile app like a uber where clients don't need to have an open app after they finished their trip. I'm not programmer but marketer so sry if my thoughts are totally wrong ;)
stari4ek commented 5 years ago

Looks like there're server-side reporting already which is used to report appstore* events. They are not exported to BigQuery and do not have any standard properties (user_id, device, ...) comparing to any other events. Here is my SO question about it: https://stackoverflow.com/questions/58300435/app-store-subscription-events-are-not-exported-to-bigquery

Legoless commented 5 years ago

Oh, you gotta be joking. There's in-app subscription events happening, which is related directly to client app, but can only be reliably detected on server side. Such as users being charged on monthly basis, trial periods, introductional periods, etc. So there is no way (apart from using a billion other tools) to directly send these events to Firebase? All analytics tools support this...

baakind commented 5 years ago

We also need this.

kopfnick commented 4 years ago

I am a little surprised that this also was not ported over from old analytics - absolutely need this for server side event logging out of things happening in the database into user lifecycles... For us especially it would also be crucial in order to get some events as conversions into ads...

voxelbustersold commented 4 years ago

Can anyone share what kind of workflow (alternatives) they have to handle this missing feature?

cemo commented 4 years ago

Is there any news on this?

rromanchuk commented 4 years ago

Not a solution, but for a pseudo (UDP analytics version) alternative, I literally send silent push notifications (iOS) packaged with event data that is pushed back to firebase from the background using client SDK.

If this is a mobile first/product/foreground only philosophy, it can easily be abused. With the “merger” of GA/Firebase, this should theoretically be supported now, they would just be events from a different platform.

The only thing I can think that might be blocking this feature is internal firbebase ML predictions. Events not generated by an active session may pollute learning models.

Also, just generally, REST apis are usually the lowest priority items, because it’s cannibalising the services they are selling. We’re supposed to be using Firestore/cloud functions, not RDS.

On Mon, Jan 6, 2020 at 4:40 AM voxelbusters notifications@github.com wrote:

Can anyone share what kind of workflow (alternatives) they have to handle this missing feature?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-admin-java/issues/137?email_source=notifications&email_token=AAAY6LDWP543IJD2B6ULVSLQ4MREZA5CNFSM4EPS53XKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIFKSZY#issuecomment-571124071, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAY6LGGLWAEDXZFQOYPDE3Q4MREZANCNFSM4EPS53XA .

kopfnick commented 4 years ago

Not a solution, but for a pseudo (UDP analytics version) alternative, I literally send silent push notifications (iOS) packaged with event data that is pushed back to firebase from the background using client SDK.

While the idea is nice, background notifications are "unreliable" at best in our (extensive) experience.

Even Apple says so in the docs - "The system treats background notifications as low-priority" (https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app)

Natteke commented 4 years ago

Updates about this feature? This would be extremely helpful if you want gather all your analytics in one place.

alxhotel commented 4 years ago

Please, consider adding support for Firebase Analytics in the server

abhinav-adtechs commented 4 years ago

A pretty good work around here would be to have an intermediate Firebase cloud function that will route all the events to your data pipeline system like kafka or another rpc. This way you can get the event (append client side firebase token in your events list) on your backend and then trigger push notifications to that client.

AoDev commented 4 years ago

Client sides analytics are being blocked more and more nowadays. All our users using Brave will simply block everything and Brave is one of the most used browsers in our business niche.

jperez1111 commented 4 years ago

Same here, it's been a feature we've been looking for for years. Server side logging is more reliable and the server posseses info that you want to include in the logging that is not available on the client side.

germandt commented 4 years ago

We also need this

bolds07 commented 4 years ago

2 years later and google still ignores this need.

i have several payment gateways in order to process users purchases in my apps. i use firebase functions as backend to process payment status changes (ipn) once the payment is approved i would like very much to log an event of 'purchase'

the current analytics archtecture forces me to log a purchase in the client side, before it has been approved or create a frankenstein of services in order to push notification back to user and then log the event

katowulf commented 4 years ago

Google Analytics is an integration. Firebase doesn't build or control the functionality. When server APIs become available for Analytics, they can be added to the SDKs. The feature request has been communicated (not ignored) and will be prioritized relative to other major feature work by the Analytics team. 2 years isn't a bad timeline for major feature development on platforms operating at scale.