question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

According to firebase latest docs it is possible to send an object with the fcm_options in order to tag each notification and filter them on the notification analytics.

https://firebase.google.com/docs/cloud-messaging/understand-delivery?authuser=0#adding_analytics_labels_to_messages

Is there a way to do this using PyFCM? I’ve tried sending it over the extra_notification_kwargs key and over the extra_kwargs key as well as over the tag key of the notify_single_device function without success.

Thanks in advance

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

1reaction
jbozascommented, Oct 29, 2020

To everyone who is still looking for a solution, I have spoken with FCM and they said:

“Make sure that the message has been sent using the HTTPv1 API and not the legacy HTTP API. Analytics labels are currently only supported with the HTTPv1 API.”

So, sending the message with "fcm_options": { "analytics_label": "testing" } and using HTTPv1 with ouath2 should be enough.

I don’t know if pyfcm already support HTTPv1, but I think I can access to the FCM options as they do here.

Suggestions are welcome!

0reactions
jturmelcommented, Nov 2, 2020

Thanks @jbozas

The bad thing about the newer API is it doesn’t support managing device groups, only individual devices so then you have to use a mix of the two.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding message delivery | Firebase Cloud ... - Google
Adding analytics labels to messages. Labeling messages is very useful for custom analysis, allowing you to filter delivery statistics by labels or sets...
Read more >
Analytics Labels for Messaging Campaigns - The Firebase Blog
With analytics labels in Cloud Messaging, you have the ability to pick and apply analytics labels to messages, which Google Analytics can use...
Read more >
How do I add an analytics label to data messages with the ...
I think I found it: Message message = Message.builder() .putData("data",data) .setFcmOptions(FcmOptions.withAnalyticsLabel("MyLabel")) .
Read more >
White-Label Dashboards for Google Analytics - DashThis
White-label Dashboards for Google Analytics. White Label Dashboard Google Analytics. Wouldn't be great if you could transform any Google Analytics report ...
Read more >
Google Analytics Event Tracking Tutorial - Optimize Smart
The 'event label' is the name assigned to the web page element whose users' interaction you want to track. You can use any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found