Unity 2022 Keeps Enabling Legacy Analytics

Hello!

The project in question does not use analytics, let alone legacy analytics. That means no analytics packages are installed.

The project was just upgraded from Unity 2021 to 2022 and the legacy analytics flag (m_Enabled) keeps getting enabled (see GitHub screenshot) whenever project settings are updated.

First time this happened I even received an e-mail from Unity saying they had detected legacy Unity analytics being enabled and that it’s now retired!

Am guessing this is a 2022 bug so just reporting.

9159179--1273988--UnityAnalyticsSetting.png

I’ve updated three different projects now (to 2022.LTS) and every single one of them is displaying this behaviour.

Both the Analytics & Legacy Analytics packages are uninstalled and\or disabled. Yet every time I open the project, the flag is set to 1 (i.e., enabled) and I have to undo the change in GitHub.

Is anyone else seeing this behaviour?

I just tried it, I don’t see the analytics getting enabled, no, it just keeps obsessively re-adding the urls for

m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
m_EventUrl: https://cdp.cloud.unity3d.com/v1/events
m_ConfigUrl: https://config.uca.cloud.unity3d.com
m_DashboardUrl: https://dashboard.unity3d.com

which is the same behaviour as 2021.

1 Like

Thanks for the info @AcidArrow

Tbh I just left those as is, assuming that if all the services were disabled they wouldn’t be used.

There used to be a bug where it would use those urls anyway, and bugs have a tendency of coming back.

Hello!

I’m on Unity 6000.0.56f1 and this is still an issue.

Each and every time the project and\or settings are saved, this flag is reverted to enabled (that is, a value of 1) and I have to discard it in source control.

I have no Analytics packages installed, including the built-in Unity Analytics.

Is anyone from Unity able to help with this please?

Hi @PeachyPixels,

Thanks for reaching out! Are you using In-App Purchasing in your project, by any chance? Legacy Analytics/Analytics used to be a dependency in the IAP package, and it was not decoupled until version 4.10. You can read about that Here.

Let me know!
Randy

1 Like

Thanks for the response @RandolfKlemola

Yes the project is using Unity IAP (specifically version 4.12.2) so it’s using the version that’s decoupled from Analytics.

There are no Analytics packages installed and the built-in Unity Analytics package is disabled in the package manager.

This issue occurs on three different projects. All these projects had Analytics enabled at some point, then subsequently uninstalled\disabled.

I raised a ticket about this a while back, but they couldn’t reproduce it and just closed it down.

Each and every time the project is saved in the editor (or auto saved on close) then the enabled flag changes to 1 and needs to be discarded in source control.

Are there any editor logs (by default or that can be enabled) that I can activate to try and help you debug the issue?

1 Like

Hi again,

Okay, understood! Let me see if I can reproduce it on my end. Just to get the steps right we have:

Unity version 6000.0.56f1
IAP Version 4.12.2.
Saving setting reverts.
Anything else, specific?

On the logging side that might help narrow this down. Unity always writes an Editor.log file. If you reproduce the issue (save → flag flips), then close Unity and check the tail end of that log, you might see entries mentioning UnityConnectSettings, or AnalyticsSettings, or something like that. You can always send me the logs in a private message as well.

1 Like

The only other thing to add to that is that the projects were created in older versions of Unity, updating to the LTS branches as and when.

So maybe start with a 2021 project with IAP & Analytics (the package, not built-in) enabled then upgrade to 2022 then 6000.

As for the logging, let me try that now and see if it reports anything. Are there any command line switches to enable extra logging?

1 Like

UPDATE : Deleted the Editor.log file, opened the project, saved it, then closed Unity.

The flag was changed from 0 to 1 but the only obvious entry (during the shutdown phase) in the log was…

Start importing ProjectSettings/UnityConnectSettings.asset using Guid(<guid>) (LibraryAssetImporter) -> (artifact id: '<id>') in 0.0073687 seconds

That said, there was also this ambiguous entry…

Service Flag set for project '<guid>'

Maybe that’s it?

1 Like

Hi @PeachyPixels ,

I will speak with the Engine team and see if we can iron out if that was it, and provide further information to you as soon as I know more. Thanks for digging into it that’s super helpful! Depending on what is said I will also test it on my end, but for not, I already have something to go with.

Randy

1 Like

Hi again @PeachyPixels ,

I realized you added Analytics and IAP for the 2021 version. Which version would that have been?

You had previously mentioned that “There are no Analytics packages installed and the built-in Unity Analytics package is disabled in the package manager.”, but I’m assuming that this was to highlight that even removing Analytics would still cause the issue?

Sorry, it was so long ago I can’t really answer that.

That said, for Analytics & Purchasing I always updated them promptly when new versions were released (during the development phase) so I would pick one that existed when 2021 went into LTS.

Whilst the Purchasing package is now 4.12.2, it would have definitely used 4.10.0 (or earlier during the 2021 & 2022 phases)

Yes, for exactly that reason.

Not only is the Unity Analytics package uninstalled, but built-in Analytics are also disabled (see attached image)

UPDATE: I just discovered the Import Activity window, so did the following…

  1. Closed Project\Unity
  2. Discarded changes in source control
  3. Opened Project\Unity
  4. Selected File → Save option (two files now show as changed in source control)

Source control reports…

  1. UnityConnectSettings → UnityAnalyticsSettings.m_Enabled = 1
  2. ProjectSettings → No content changes (suspect maybe file date\time was changed, but not content?)

I appreciate in the grand scheme of things, these are not critical issues. But for those using source control, it’s really annoying and requires constant discarding of changes.

I hope this all helps.

Hi again @PeachyPixels ,

The extra work you’re doing is much appreciated. To be honest, I haven’t used Source Control myself, but for this test I will include just to be able to see the same results as you. Is there anything specific you think might be worth knowing to mimic your usage (for this test, anyways)?

1 Like

Thanks @RandolfKlemola

This affects three of my projects, which had the following in common…

  1. All three had analytics enabled in 2017-2021 versions of Unity
  2. All three had their Unity version updated (across one or more major versions)
  3. All three had analytics removed

As mentioned in my original post, the issue was first noticed when updating to 2022.

I’m willing to bet the issue is something to-do with the above. That said, I’m surprised few\any others seem to be experiencing this (so please speak up if you are)

Just ask if you have any further questions, I’ll try and help where possible.

1 Like

@RandolfKlemola

I was thinking about this last night and it might be worth working backwards initially.

So instead of trying to replicate the issue, you find all instances of where that flag is updated in code and back track.

I have a hunch that in this case it might be the faster approach to finding the issue.

Just an idea anyway.

1 Like

Hi again,

Alright, so I’ve definitely reproduced your issue. The flag is re-enabled whenever I change a project setting after a reboot. I also need to have the In-App Purchasing flag enabled as well.

Yes, for sure. Most won’t notice this, but anyone using source control & IAP/Analytics may. Chances are they haven’t because they just accepted this setting once and never looked back. Out of curiosity, is it possible to leave it enabled, or is there some other reason you want to have this disabled permanently (as a workaround, for now).

1 Like

Thanks, that’s excellent news. At-least I know I’m not going mad now :grin:

The reason for wanting this disabled is that I’ve no idea what effect it might have on device builds, whether that’s now or in the future.

I’m also making the assumption (rightly or wrongly) that even though the flag is disabled in the source control file, there is a possibility that it could be silently enabled in the build pipeline process.

Apple in particular is very strict with this sort of thing. Given that the app listing states zero analytics, I want to make sure that it’s fully disabled and I’m true to my word.