简体   繁体   中英

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 .

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

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

What should I do now?

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:

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

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

You need to enable Google Analytics first in the integration tab then you can follow Jijo John's answer.

Firebase 测量 ID

In case anyone trying to find it from the Firebase web console

  • it is displayed when you enable Google analytics first time for the project.
  • For seeing the existing firebase configuration

Firebase Console -> Project Settings -> General -> Select your Web App -> Select 'Config'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM