簡體   English   中英

Sending Google Analytics Events via API: How to get app_instance_id or client_id from Firebase SDK from web client?

[英]Sending Google Analytics Events via API: How to get app_instance_id or client_id from Firebase SDK from web client?

如何從 web 客戶端(不是gtag.js )從 Firebase SDK 獲取app_instance_idclient_id

參考: https://developers.google.com/analytics/devguides/collection/protocol/ga4/sending-events?client_type=firebase

我使用firebase/installations

const installationId = await installations.getId(
      installations.getInstallations()
    );

但是當在 ga4 api 驗證具有此類installationId ID 的請求時,我得到:

description: "Measurement app_instance_id is expected to be a 32 digit hexadecimal number but was [22] digits."
fieldPath: "app_instance_id"
validationCode: "VALUE_INVALID"

如果我正確理解您的問題,您正在從 Firebase SDK 搜索app_instance_idclient_id

最簡單的選項是允許在 Firebase 集成中流式傳輸到您的 BigQuery 表中。 然后在 BigQuery 日內表中找到您的app_instance_idclient_id

在 BigQuery 中,您將在以下列下找到它: app_instance_id = user_pseudo_id client_id = user_id 在此處輸入圖像描述

另一種選擇是設置一個代理——比如Charlesmitm並從你的應用程序中獲取真實的日志。 然后你就可以輕松 grep 了。

另一個選項#2 是安裝adb 並使用 logcat 瀏覽連接設備到您的 PC 的日志(最好是 Android 設備。我沒有使用 iOS 設備的經驗)

我希望這會有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM