How to find the Analytics Label field from FCM in GA4 (GBQ tables)

70 Views Asked by At

We are creating push notifications campaigns with Firebase Cloud Messaging. When you create a campaign, you have an analytics label field, as you can see in the image below:

enter image description here

Is there any way to retrieve this data in GA4 (GBQ)? I can retrieve this data from the FCM API, but I want to know if I can find this field in GA4 in any particular way in GBQ.

I've read this FCM documentation about analytic labels but there is no clue about this: https://firebase.google.com/docs/cloud-messaging/understand-delivery

1

There are 1 best solutions below

0
MatmataHi On

I've seen this label is located inside the event_params.key as 'label'. You can select the event_name as 'notification_open' and then the event_params.key to retrieve the opens for a specific label.

Here is the generic code to find this data:

SELECT
 *
FROM
  `your-table`,
  UNNEST(event_params) AS param 
WHERE
  session_date = '2023-09-25' -- update to your desired start and end date
  AND param.value.string_value="add here your analytics label"
  and event_name = 'add here your own FB event'