-
Notifications
You must be signed in to change notification settings - Fork 870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After relinking Firebase project to analytics, get "The measurement ID in the local Firebase config does not match the measurement ID fetched from the server" #4291
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Here's some more evidence that something screwy is going on with unlinking and relinking. Every time I unlink and relink, a new "property" is created under my Google Analytics account. I can see in the debug view for an old property that my data is still being logged there, since my code thinks it should be using an old |
Created an internal bug b/177555355 for the team that controls the dynamic config endpoint. In the meantime, how long do you wait after relinking? I wonder if there's a delay for the dynamic config backend (that serves the fetched config) to update, after you relink. |
@hsubox76 I was wondering if waiting would fix it, but it looks like it didn't. I tried again just now and am still seeing the same error. It's been 10+ hours since relinking. Also just to clarify, is the bug you filed for the issue where you can't edit the stream configuration? |
I think that UI is intentional but it is out of scope of this repo. The bug I filed is for the exact issue you brought up originally, which is that whatever populates the measurementId in the object fetched by the dynamic config fetch call is not updating when you unlink and relink a Google Analytics account. I referenced this issue. |
Ah gotcha, thanks. Do you know where would be a good place to report a bug for the other issue (the one I screenshotted)? It prevents me from configuring enhanced measurements when Firebase is linked. |
I just tried it again, and now it works! The behavior still seems buggy if you have to wait this long though. Unfortunately, this also means that my enhanced measurements are no longer working as I'd like them to, since they're going to the property whose stream configurations are locked down (see screenshot above). So... actually, it was kinda nice to have the buggy behavior, since it nicely compounded with another bug—that is, it meant I could look at the Debug View in Google Analytics instead of Firebase and was able to edit the stream configurations. Oh well. |
should i just be using g4 web datastream? I dont understand the firebase web data stream. It wants to redirect back to firebase, but where are all the configuration settings like Enhanced measurement, Measurement Protocol API secrets, connected site tags, etc? I'm not using the |
Due to the unavailability of enhanced measurements https://support.google.com/firebase/answer/9234069?hl=en&ref_topic=6317484&authuser=0# firebase/firebase-js-sdk#4291
I just ran into OP's issue as well. @arcticmatt, what were the steps you took to resolve this issue, or was it a seemingly random success? Seems frustrating that there is no way to update the Why does the @hsubox76 Any update on the status of the internal bug? |
It sounds like in his case there was just a delay in updating. Setting the measurement ID from the local config is only used as a backup if the dynamic config cannot be fetched. The dynamic config is intended to be the main source of truth. The reasoning behind this decision was that the Firebase project's measurement ID may change due to moving streams, or linking and unlinking them, and that someone doing so on the backend shouldn't require any changes in the front end code. That said, the delay might be longer than is acceptable, or should at least be documented. Or if it's not updating at all, we should escalate the bug. How long has it been since you unlinked/relinked and if you're able to get it working again, how long after was it? If there is a delay, and I can get an idea of how long it is, I can report it on the internal bug and try to get a response again. |
The You mentioned documentation about this delay (if it isn't a bug), and I think that would be awesome. I think the best approach would be some sort of notification on the UI about a possible discrepancy and/or delay, but I think that the UI is not in this particular issue's scope.
That makes more sense from a larger multi-team perspective. I am in the full-stack mindset right now since we're a very small team with no dedicated front/back end teams right now. Thanks for your speedy reply! Let me know if any other info would be useful. |
I have the same issue now. Its been 10 hours and i still get the error what am I supposed to do? |
It seemed to take about a day for the other two people that reported it, so let me know if it doesn't fix itself within a day. I'll try to talk to the team that handles dynamic config and see if I can get any clarity on if this is intended behavior. It'll be good if I can gather as much info as possible on roughly how long the delay seems to be. |
yeah it took a day. it is working now. thank you @hsubox76 |
It looks like a 24 hour delay is standard. I'll try to find a way to add this to our documentation so no one else is taken by surprise. |
I've hit this same issue now, going on 17 hours now and still not working. |
I'm facing the same issue. Hope this gets included in the documentation soon! |
We're working on getting it added to documentation somewhere, thanks for alerting us to the additional case (no analytics, then linked it later). |
Added a note to the documentation here under "Link your Firebase project to Analytics": https://support.google.com/analytics/answer/9289234 |
@hsubox76 Please, can this also be added to the setup guide on Firebase? Wasted a couple of hours head-scratching until I landed here. MIne was a first-time setup. |
For people having trouble with a delay on a "first-time setup", can you describe the steps you took? Did you enable analytics when creating the project and still see a delay, or did you not initially enable analytics on your project, and then enabled it after the project had already been created, and then you saw a delay? Did you use the automatically provided measurement ID or did you link another measurement ID? Just want to be clear so the documentation changes will be accurate. Thanks. |
Closing this, if anyone is having problems with a delay on a "first-time setup", if you can answer the questions in the comment directly above, I will update the documentation as needed or reopen this to make any fixes if needed. Thanks. |
Describe your environment
Describe the problem
I unlinked and relinked Analytics from my project more than once following these instructions. Each time I relink, the Firebase console shows me a new
measurementId
.However, when I try to use the new
measurementId
in my Firebase config, I see this error in the console:The former ID is the ID I see in the Firebase console. The latter ID is the original
measurementId
before I unlinked and relinked. Based on this, it seems like themeasurementId
fetched automatically from the server is out-of-date and does not respect unlinking and relinking to analytics.Note that I originally unlinked Analytics from Firebase because I wanted to configure enhanced measurements, but was unable to. https://stackoverflow.com/questions/63816141/how-can-i-configure-enhanced-measurements-for-a-google-analytics-app-web-prop describes the issue I was hitting. The fact that data is still going to the old
measurementId
, while a bug, also happens to solve this problem. That is, after unlinking, I can configure enhanced measurements (you can't do this when it's linked), and since data still goes to the oldmeasurementId
, those changes take effect.Steps to reproduce:
Described above.
Relevant Code:
I'm basically doing something like this:
Once default events like
page_view
start getting logged (which I see in the console since I'm using the Google Analytics Debugger extension), I see the aforementioned error in the console.The text was updated successfully, but these errors were encountered: