我有几个Firebase项目,其中使用了Firestore和Firebase Storage。
我想开始使用Google Analytics,看到了这个页面,里面有所有的指令。其中关键的设置是参数“measurementId”。 所以,按照说明,我进入我的项目设置,找到配置代码片段,但与说明不同,它并没有包含此参数...
如何生成这个参数?
我有几个Firebase项目,其中使用了Firestore和Firebase Storage。
我想开始使用Google Analytics,看到了这个页面,里面有所有的指令。其中关键的设置是参数“measurementId”。 所以,按照说明,我进入我的项目设置,找到配置代码片段,但与说明不同,它并没有包含此参数...
如何生成这个参数?
我也遇到了这个问题。看起来网站上有一个错误。请安装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
。