Failures/Warnings when retrieving measurementId via GetDynamicWebConfig

Describe your environment

  • Operating System version: Windows
  • Browser version: 85
  • Firebase SDK version: 7.21.1
  • Firebase Product: all

Describe the problem

After updating to the latest versions, I now see a 403 and warning during initialization

“index.esm.js:106 [2020-10-01T19:41:18.520Z] @firebase/analytics: Failed to fetch this Firebase app’s measurement ID from the server. Falling back to the measurement ID XXXXXX provided in the “measurementId” field in the local Firebase config. [Analytics: Dynamic config fetch failed: [403] Requests to this API method google.firebase.service.v1alpha.DynamicConfigService.GetDynamicWebConfig are blocked. (analytics/config-fetch-failed).]”

I have tried granting access to all the following, but the error persists:

  • Cloud Firestore API
  • Identity Toolkit API
  • Firebase Installations API
  • Places API
  • Maps JavaScript API
  • Token Service API
  • Firebase Remote Config API
  • Firebase Dynamic Links API

The config object does have a measurementID passed in, but the SDK seems to ignore this unless there is a failure. Nothing else was changed.

2 thoughts on “Failures/Warnings when retrieving measurementId via GetDynamicWebConfig

  1. So the API you need to enable should be the Firebase Management API. Let me know if that solves the problem (also if it doesn’t).

  2. Thanks so much! Adding Firebase Management API resolved the error.

    We have our client side API key locked down as much as possible with website and API restrictions. With this being client side JS, this API key only has access to firebase and maps APIs.

    The application behavior was unchanged and I found the PR with the updated logic, so I figured this was a callout to a new service that wasn’t already enabled. It just wasn’t clear what service would need to be enabled (you would think just remote config). It might be helpful to add a note to the changelog in case others run into the same issue. Thanks again for the help!