如何从Firebase配置中获取MeasurementId? [英] How to get the measurementId from the Firebase config?

查看:119
本文介绍了如何从Firebase配置中获取MeasurementId?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要针对Firebase上的基于Web的项目使用 Google Analytics(分析),我们需要使用Firebase保留的URL或复制/更新Firebase配置对象,因为文档说明

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 setup:web .

I am using the following command to print that config information though: firebase setup:web.

问题在于它没有打印 measurementId 字段.

The problem is that it is not printing the measurementId field.

我现在该怎么办?

推荐答案

实际上, firebase setup:web 并未打印 measurementId .但是,如果您参考 Firebase CLI参考,您会发现此命令已被弃用:

In fact the firebase setup:web is not printing the measurementId. But if you refer to Firebase CLI reference you can see that this command is deprecated:

已弃用.而是使用apps:sdkconfig并将web指定为平台参数.

Deprecated. Instead, use apps:sdkconfig and specify web as the platform argument.

您现在应该使用 firebase apps:sdkconfig .通过该命令,您将具有 measurementId .

You should now use the firebase apps:sdkconfig. From that command you'll have the measurementId.

这篇关于如何从Firebase配置中获取MeasurementId?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆