Firebase和Google Analytics-缺少MeasurementId?

问题描述 投票:1回答:2

我有一些使用Firestore和Firebase Storage的Firebase项目。

我想开始使用Google Analytics(分析),所有说明都显示为this page。关键设置是参数“ measurementId”。因此,按照说明进行操作,我转到项目设置并找到配置代码段,但与说明不同,它不包含此参数...

enter image description here

我如何生成它?

firebase firebase-analytics
2个回答
0
投票

我也经历过。网站上似乎有错误。设置Firebase CLI并运行以下命令。

firebase --project <project-name> apps:sdkconfig

它应该输出如下内容:

? Select the app to get the configuration data: Web - 1:686396208177:web:5119a766dc890b7d671110 (WEB)
✔ Downloading configuration data of your Firebase WEB app
// Copy and paste this into your JavaScript code to initialize the Firebase SDK.
// You will also need to load the Firebase SDK.
// See https://firebase.google.com/docs/web/setup for more details.

firebase.initializeApp({
  // ... snip ...
  "measurementId": "redacted"
});

包括measurementId


0
投票

该解决方案来自Firebase支持,我的项目需要“重新链接”到Google Analytics(分析)。

将您的Firebase项目重新链接到移动应用程序属性

如果以前将您的Firebase项目与您的Analytics(分析)帐户相关联但无法再在Google Analytics(分析)中找到您的Firebase项目:

  1. 打开您的Firebase项目。

  2. 打开项目设置>集成。

  3. 单击Analytics(分析)卡将Analytics(分析)链接到您的项目。

更多详细信息here

© www.soinside.com 2019 - 2024. All rights reserved.