24

I'm sending messages to several iOS Apps via FCM by using their HTTP protocol API,

and I need a list of message records including the payload, sent time, and platform like what I could monitor in the Firebase Notification Console.

It seems that messages sent via HTTP API wouldn't be recorded and shown in the console (only those sent manually in the console would).

I haven't found any API documents related to those messaging events/log fetching.

Is there a way to fetch this kind of message information from FCM?

bluenowhere
  • 2,683
  • 5
  • 24
  • 37

2 Answers2

26

As of August 2018, stats for messages sent using the FCM API are now visible from the console. From the Cloud Messaging section, click on the Reports tab. From there, you will be able to filter by message type (notification, data, and all)

enter image description here

It would seem that the Impressions and Opens are still only available for messages sent using the console. But Sends for sure now counts the messages sent using the FCM API.

Reference: https://firebase.googleblog.com/2018/08/in-app-messaging-crashlytics.html


Update: The FCM Diagnostics page has been disabled since last year.


If you have a Play Dev Console account and if your app is in at least Alpha Testing, you can make use of the Diagnostics and Statistics page. However, if you're looking for an API, there is currently no API available for it.

Otherwise, I think most of the details you need (like the payload and time sent) can be logged from your app server alone.

And just to support what you already mentioned in your post, as stated by @FrankvanPuffelen here:

The Firebase Notifications charts only show analytics for messages that were sent using the Firebase Notifications panel.

There is currently no public API to send Notifications to audiences. The web interface in the console is the only way to send them.

There is currently no API to feed your own FCM messages into the Firebase Notifications analytics panels.

Community
  • 1
  • 1
AL.
  • 36,815
  • 10
  • 142
  • 281
  • You can send messages to audiences using API. However sending notifications using the API seems to leave no statistics, unfortunately. – Jonny Feb 13 '18 at 00:57
  • @Jeff Could you point out to a much more documented link? It's not clear that the FCM stats sent using the API would show up. We currently have projects using FCM and we don't see any stat reflecting. – AL. Oct 10 '18 at 16:39
  • 1
    I don't see any other documentation for it at the moment. From the blog post: "In addition to aggregating all these statistics, the reporting dashboard also gives you insight into your API sends from the console, for the first time". It also includes a ([screenshot](https://1.bp.blogspot.com/-yA3wk1OB298/W3WWXqgAH7I/AAAAAAAACY4/ZhSGFtUOBt0Xg-9Z9QwLwl_pxva8Q7W5ACLcBGAs/s1600/YTt6pAcbqmE.png)). Can you see the "Reporting" tab in your FCM console? – Jeff Oct 10 '18 at 16:45
  • 1
    @Jeff I found it. My mistake for not navigating to the *Data/All* tab. I'll update my answer(s) that shows the same info. Cheers! – AL. Oct 10 '18 at 16:49
  • 1
    Glad to hear it! Thanks :) – Jeff Oct 10 '18 at 16:50
  • 3
    it seems i can't find a list of my test logs. I am not really into finding stats rather than finding what happened to a specific message I sent. there used to be a page for that, but now, i can't find it. Are tests recorded in the stats too? – TatiOverflow Apr 26 '19 at 19:09
  • @Jonny As you said "Sending notifications using API seems to leave no statistics" i am getting statistics of iphone devices but not for android. – NarenderNishad Jul 09 '19 at 11:37
  • @AL. is there a way that i can set the conversion event when sending push notification from my Server to FCM API? – Muhammad Omar ElShourbagy Jun 02 '20 at 16:15
  • @MuhammadOmarElShourbagy I'm not sure what you mean by triggering the conversion event. Is this related to the stats shown on the console? In any case, I haven't seen any updates regarding the stats sources, if it already has the ones sent using the APIs (it has been a while since I last checked so I suggest checking around the docs and recent release notes / blog posts). Cheers! – AL. Jun 02 '20 at 16:55
  • @AL. from the console when sending new notification message, it gives you option to choose conversion event. i was asking about a way to set that when sending notification from server. – Muhammad Omar ElShourbagy Jun 03 '20 at 08:31
1

If you want to fetch data on push notification client side you could use the BigQuery exports of Analytics data.

Here is a list of events, as you can see there are several events on notifications, including notification_open and notification_send.

Unfortunately notification_send seems to be available only for Android apps. I don't know why since the Firebase GUI console Message Delivery Report does contain iOS sends as well.

Giacomo
  • 1,796
  • 1
  • 24
  • 35
  • I should also add that I cannot find the event 'notification_send' for iOS either. There aren't any events 'notification_send' in the BigQuery exports of Analytics data. – Giacomo Nov 02 '21 at 16:48