4

Is there any way to perform Server-side event tracking?

Every call to my Firebase function, has to go through multiple steps. I couldn't monitor it through console logs. Actually I need to prepare an report at end of every week and month.

Looking for the better way to do this. Is there any better tool available other than Google Analytics?

Appreciate your help!

Karthi R
  • 1,338
  • 10
  • 25

1 Answers1

7

As of late 2020 it is possible to log events from server-side code with the Analytics Data API and the GA4 Measurement Protocol documentation on sending events with this REST API, which you can use from Cloud Functions (and almost any other environment).

Old answer

There is no server-side API for Google Analytics for Firebase.

Some options to consider:

  • Insert events directly from the clients that also trigger the Cloud Functions.
  • Use regular Google Analytics for these stats.
  • Insert the events into BigQuery and use Data Studio for reporting.
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Any changes on this topic? I have the same problem exactly. My web-app is using Firebase Functions as backend, but I need to do some server-side tracking to Google Analytics because Firebase Analytics is working only with mobile apps – AAverin Mar 30 '19 at 08:52
  • How this `logEvent function is even wrapped in the Node.js Admin SDK`? I can not find how to call from Functions Admin SDK – FlutterFirebase Apr 20 '21 at 16:32
  • Nope, I must've misread the documentation. It's a REST API only for the moment. – Frank van Puffelen Apr 20 '21 at 19:13