firebase-admin-java icon indicating copy to clipboard operation
firebase-admin-java copied to clipboard

FR: Firebase Analytics Server Side

Open cemo opened this issue 7 years ago • 42 comments

My Environment:

  • Operating System version: Any
  • Firebase SDK version: Any
  • Library version: Latest
  • Firebase Product: analytics

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.

cemo avatar Feb 07 '18 13:02 cemo

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.

hiranya911 avatar Feb 07 '18 17:02 hiranya911

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.

cemo avatar Feb 07 '18 18:02 cemo

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?

avishalom avatar Feb 14 '18 22:02 avishalom

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

cemo avatar Feb 15 '18 09:02 cemo

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/

esprehn avatar Feb 16 '18 03:02 esprehn

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.

adam-hurwitz avatar May 24 '18 18:05 adam-hurwitz

@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.

rromanchuk avatar Aug 04 '18 09:08 rromanchuk

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.

nightrise avatar Aug 09 '18 17:08 nightrise

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

namanyayg avatar Aug 14 '18 19:08 namanyayg

Also interested in this. Any updates?

dabramovici avatar Aug 15 '18 13:08 dabramovici

Please upvote issue as well

cemo avatar Aug 15 '18 13:08 cemo

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

namanyayg avatar Aug 15 '18 13:08 namanyayg

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

andvalsol avatar Nov 17 '18 12:11 andvalsol

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.

samdozor avatar Dec 20 '18 20:12 samdozor

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.

ToddKerpelman avatar Dec 21 '18 18:12 ToddKerpelman

@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.

cemo avatar Dec 22 '18 18:12 cemo

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

stari4ek avatar Jan 30 '19 21:01 stari4ek

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

lauri3new avatar Feb 25 '19 14:02 lauri3new

We also need this.

n-sviridenko avatar Apr 29 '19 06:04 n-sviridenko

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.

Energy0124 avatar May 07 '19 15:05 Energy0124

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 :(

n-sviridenko avatar May 12 '19 08:05 n-sviridenko

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

copilots-app avatar May 15 '19 08:05 copilots-app

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

puf avatar Jul 07 '19 13:07 puf

@ToddKerpelman, Is there any update on this?

cemo avatar Sep 26 '19 13:09 cemo

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?

voxelbustersold avatar Oct 02 '19 13:10 voxelbustersold

@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 2. 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 ;)

mmilowski avatar Oct 09 '19 18:10 mmilowski

Looks like there're server-side reporting already which is used to report app_store_* 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

stari4ek avatar Oct 10 '19 06:10 stari4ek

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...

Legoless avatar Oct 25 '19 13:10 Legoless

We also need this.

baakind avatar Nov 06 '19 12:11 baakind

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...

kopfnick avatar Nov 22 '19 13:11 kopfnick