Debugging FCM unreceived data messages - firebase

I recently looked at the Firebase FCM console for the first time, and got surprised to see we send data messages. I was even more surprised to see that they don't seem to be received!
I activated syncing data to BigQuery, and played around with the data a bit (data available for just last few days, that's why the numbers are low compared to the graph above):
SELECT event, COUNT(*) FROM [firebase_messaging.data] WHERE message_type = 'DATA_MESSAGE' GROUP BY event;
As you can see above, none seems to have been delivered.
Also, here's some raw BigQuery data:
Questions:
1) How can I figure out where these data messages are actually being sent? As far as I can see in our code, we only send notification messages. Maybe it's a 3rd party service? Maybe we do send it ourselves but I missed?
2) Related to the above: is there a way I can look into payload of data messages? BigQuery (as can be seen in the above screenshot) does not show this.
3) What are some possible reasons why these data messages aren't being received?

Related

Google Analytics 4 reported for api outdated data

My goal - getted actual data from report GA4 in Backend app, how is it done in the dashboard. But, problem - report contains only part of data. I want get active users with city in interval last half on hour. I do it like this:
BetaAnalyticsDataClient.create().use { analyticsData ->
val request: RunReportRequest = RunReportRequest.newBuilder()
.setProperty("properties/$propertyId")
.addDimensions(Dimension.newBuilder().setName("city"))
.addMetrics(Metric.newBuilder().setName("activeUsers"))
.addDateRanges(DateRange.newBuilder().setStartDate("today").setEndDate("today"))
.build()`
I get a result in which there are no cities that are currently in the dashboard on the map. I had tried in GA4 settings interval updating data, i not found this. What is reason? Thanks!
The Method: properties.runReport is the standard GA4 report, and is limited to data that has been processed. Data processing takes between 24 and 48 hours it is not meant for real time.
You need to use the Creating a Realtime Report if you want real-time data, and you are limited to the dimensions and metrics available real-time these reports are very limited.
I guess what i am saying is you are running the wrong report, and you should not expect to get the data you want from the Realtime report.

FCM topic limits and expiration/invalidation of old unused topics?

I have been using FCM topics for a while now, but the documentation is very limited and most searches leads to the same pages, so I am asking here, in hope someone has enough experience on the subject to answer my questions.
I am wondering if there is a limit to how many topics are allowed and what happens to topics that are no longer in use? I mean, when will a topic be invalid?
I have had issues where unsubscribing from a topic didn't seem to work, even if I get a positive response back or other times the notifications have been sent twice.
To get around this, I am currently making a new command, but unlike before, every time the command is run, I will subscribe tokens to a unique topic, send the notification, unsubscribe token and then that topic will never be used again. This is a way for me to have better control over which users gets subscribed to certain topics, as FCM offers no help with this, that I am aware of.
So here my question is, should I unsubscribe all the tokens again afterwards, letting FCM know that it is no longer in use, or would that be pointless to do? (In case they have some sort of clean up in place)
Hope someone can guide me in the right direction.
I am wondering if there is a limit to how many topics are allowed...
No limit.
...what happens to topics that are no longer in use? I mean, when will a topic be invalid?
A topic is created when there is at least 1 subscriber and it also gets automatically deleted when there are no more subscribers.
To get around this, I am currently making a new command, but unlike before, every time the command is run, I will subscribe tokens to a unique topic, send the notification, unsubscribe token and then that topic will never be used again. This is a way for me to have better control over which users gets subscribed to certain topics, as FCM offers no help with this, that I am aware of.
This use case doesn't seem to be wrong per se. It's just a bit unconventional (although I'm pretty sure I suggested something like this before).
Currently, with FCM v1, the registration_ids parameter (used to send to multiple token -- 1000 each request) is no longer advised. FCM team seems to be moving towards using topics for sending to multiple tokens. With that said, IMHO, I think the use case is valid.

Firebase + BigQuery - Uniquely Identifying Devices

Recently started exploring the Firebase data via the Data Studio Firebase connector. I'm doing some custom reports based on the user_engagement event to compare with data we previously reported on in Flurry.
When looking at some DAU figures they are pretty close but on MAU they tend to get inflated. (Saw this behavior first on the Firebase Events Report Template). Digging into it a little more we do have a pattern where users frequently reinstall the app which generates a new app_instance_id. So as I fallback I'm using the resettable_device_id but then there's the situation advertising tracking is disabled on device resulting in a zeroed value. (Or for a brief period in January nulled out values, not sure if this was client or part of the Firebase link)
Currently thinking something roughly following the logic below, falling back to app_instance_id if the advertising identifier was not set. What approaches would be worth looking into to have a reliable user identifier for metrics reporting? (In future will be calling the setUserID to utilize our own identifier but looking to match up historical data)
IF(user_dim.device_info.resettable_device_id is not null,
IF(user_dim.device_info.resettable_device_id = '00000000-0000-0000-0000-000000000000', user_dim.app_info.app_instance_id, user_dim.device_info.resettable_device_id),
user_dim.app_info.app_instance_id
) as unique_user_identifier,
Thanks in advance.
Simpler way to deal with the cases where a resettable_device_id is not available:
IF(user_dim.device_info.limited_ad_tracking, user_dim.app_info.app_instance_id, user_dim.device_info.resettable_device_id) as unique_user_identifier

How to query the same crash count from BigQuery as Firebase crash reporting dashboard shows

I have tried to write a query to get number of crashes from BigQuery for certain day. But the number that I got from query doesn't match the number that I can see on Firebase crash reporting dashboard.
So what I am doing wrong?
Here is the query:
SELECT
event_dim.date AS CrashDate,
-- doesn't matter what event_dim field we choose
COUNT(event_dim.name) AS CrashCount,
FROM
TABLE_DATE_RANGE(com_sample_ANDROID.app_events_, TIMESTAMP('2017-01-27'), TIMESTAMP('2017-01-27'))
WHERE
event_dim.name = 'app_exception'
AND event_dim.params.key = 'fatal'
AND event_dim.params.value.int_value = 1
GROUP BY
CrashDate
There are a couple of things to know about what you're trying to do.
First, there is throttling in the Crash SDK that will prevent grossly repeated requests from being sent to the server. This defends us against sloppy programming in the app that could spam us. Analytics may have a different reckoning about what happened, because it's different code.
Second, for apps that legitimately send a lot of data, we may perform a sampling of the data, which means we lose some accuracy but gain a lot of speed. At that scale, you shouldn't expect your numbers to be exact (and it shouldn't matter, because the numbers will be big).

enabling hourly data in google analytics

I have two view/profiles linked to my google analytics account. I want to fetch the hourly data for the current day, ie
start date:today
end date: today
with a few filters and dimensions.
Now I am getting the response for one view that means it is possible in google analytics, however for the other view its showing all the values as 0- this applies both to the gui and the api.
Can anyone suggest me how to enable it for the other view as well?
You cannot. Google Analytics needs some processing time. It might be that some data appears immediately, especially on small accounts, but it's not guaranteed and not a thing you can "enable" or count on.
Updated: Okay, that was a dumb answer. Still, there is a processing latency event in GA Premium. It is possible to get realtime data, but that's a different API with limited data (the core reporting API might return data, but no guarantees for that).
But I admit, since your problem is that you do not get data for the whole day yor have a different problem. But with a premium account you should be able to contact your account manager/technical support.

Resources