l1b3rty
l1b3rty

Reputation: 3660

Firebase Cloud Messaging - Adding analytics labels to messages

I have a very specific question for web push notification via the FCM: how do I add analytics labels to my notifications?

According to the documentation:

Labeling messages is very useful for custom analysis, allowing you to filter delivery statistics by labels or sets of labels. You can add a label to any message sent via the HTTP v1 API by setting the fcmOptions.analyticsLabel field in the message object

I am sending my push notification via a Node.js Firebase Cloud Function using the messaging.send(Message) method. When I read the documentation of the Message object I understand that the only place to set this label in my case is here:

{
  ...
  fcmOptions: {analyticsLabel: [string}
  ...
}

Is this correct? This answer on SO also seems to indicate so

I have done this and I still dont see the label appearing in my Firebase Console, by this I mean when I go to https://console.firebase.google.com/u/0/project/{myprojectname}/notification/reporting and I try to filter by data I get no data:

enter image description here

Upvotes: 3

Views: 2967

Answers (3)

LuisFerrolho
LuisFerrolho

Reputation: 417

In addition to @vmintam post, I leave here another feedback from Firebase's support team from some days ago.

"Hello, Here is an update from our team. They have mitigated this issue on our end and are able to see the analytics_label. Unfortunately, they also won't be able to backfill the missing data during the outage, since the analytics_label was missing from that time. If still you aren't able to see the analytics_label, please reach back out with a screenshot displaying it."

We already could confirm that "Sends" metric and analytics label is being registered again, so at least for us the problem is solved.

Upvotes: 0

ruslangm
ruslangm

Reputation: 703

Looks like it was fixed a few days ago. At least our analytics dashboard in firebase console suddenly became normal and started to display sending events as well.
No release notes or even any answer from the firebase technical support team though. Weird.

Upvotes: 0

vmintam
vmintam

Reputation: 96

i think that your code is OK. In my case, reports in FCM have error from 05/14/2021. I have just sent ticket to FB 's support. If I get any news, i will reply.

Update 02/06/2021: From Firebase's support team : "We’ve received similar reports regarding this issue, and I would like to include your project details to that report" ==> Wait FB engineer team resolve this problem. Continue update when i have new message.

Upvotes: 7

Related Questions