[英]How to get the measurementId from the Firebase config?
To play with Google Analytics for Web based projects on Firebase we need to use either the Firebase reserved URLs or to copy/update the Firebase config object as the documentation states here .要在 Firebase 上使用基于 Web 的项目的Google Analytics ,我们需要使用 Firebase 保留的 URL 或复制/更新 Firebase 配置object ,如此处文档所述。
I am using the following command to print that config information though: firebase setup:web
.不过,我正在使用以下命令打印该配置信息:
firebase setup:web
。
The problem is that it is not printing the measurementId
field.问题是它没有打印
measurementId
字段。
What should I do now?我现在应该怎么做?
In fact the firebase setup:web
is not printing the measurementId
.事实上,
firebase setup:web
不打印measurementId
。 But if you refer to Firebase CLI reference you can see that this command is deprecated:但是如果您参考Firebase CLI 参考,您会发现此命令已被弃用:
Deprecated.
已弃用。 Instead, use apps:sdkconfig and specify web as the platform argument.
相反,使用 apps:sdkconfig 并指定 web 作为平台参数。
You should now use the firebase apps:sdkconfig
.您现在应该使用
firebase apps:sdkconfig
。 From that command you'll have the measurementId
.从该命令中,您将获得
measurementId
。
You need to enable Google Analytics first in the integration tab then you can follow Jijo John's answer.您需要先在集成选项卡中启用 Google Analytics ,然后您可以按照 Jijo John 的回答进行操作。
In case anyone trying to find it from the Firebase web console如果有人试图从 Firebase 网络控制台中找到它
Firebase Console -> Project Settings -> General -> Select your Web App -> Select 'Config' Firebase 控制台 -> 项目设置 -> 常规 -> 选择您的 Web 应用程序 -> 选择“配置”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.