l1b3rty
l1b3rty

Reputation: 3642

Firebase and Google Analytics - missing measurementId?

I have a few Firebase projects on which I use Firestore and Firebase Storage.

I want to start using Google Analytics and I see this page with all the instructions. The key setting being the parameter "measurementId". So, following the instructions, I go to my project settings and find the config snippet but unlike in the instructions it does NOT contain this parameter...

enter image description here

How do I generate it?

Upvotes: 4

Views: 3894

Answers (2)

l1b3rty
l1b3rty

Reputation: 3642

The solution came from Firebase support, my project needed to be "relinked" to Google Analytics.

Relink your Firebase project to a Mobile App property

If you had previously linked your Firebase project with your Analytics account but are no longer able to locate your Firebase project in Analytics:

  1. Open your Firebase project.

  2. Open Project settings > Integrations.

  3. Click the Analytics card to link Analytics to your project.

More details here

Upvotes: 6

0xcaff
0xcaff

Reputation: 13681

I experienced this also. It seems there is a bug in the website. Set up Firebase CLI and run the following command.

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

It should output something like the following:

? 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"
});

It includes measurementId.

Upvotes: 0

Related Questions