Search Unity

Bug Unity Analytics clientVersion changed after RemoteConfigService.Instance.FetchConfigs

Discussion in 'Unity Remote Config' started by aronze_unity, Feb 1, 2023.

  1. aronze_unity

    aronze_unity

    Joined:
    Jan 23, 2018
    Posts:
    1
    I found a strange problem that changed clientVersion after called RemoteConfigService.Instance.FetchConfigs.

    First, when after UnityService initialized, clientVersion is right.
    upload_2023-2-1_14-56-27.png

    upload_2023-2-1_14-55-42.png

    But, after then I called RemoteConfigSerivce.Instance.FetchConfigs.

    upload_2023-2-1_14-57-43.png
    upload_2023-2-1_15-1-5.png
    After that, All my custom events clientVersion reported with changed (3.1.3+RCR).

    I was initialize UnityService with our custom userId after our server login like this:

    Code (CSharp):
    1. var options = new InitializationOptions();
    2. options.SetOption("com.unity.services.core.environment-name", GetCurrentEnvironment());
    3. options.SetOption("com.unity.services.core.analytics-user-id", userId);
    4. await UnityServices.InitializeAsync(options);
    And then called RemoteConfig fetch.

    Code (CSharp):
    1. if (!AuthenticationService.Instance.IsSignedIn)
    2. {
    3.     await AuthenticationService.Instance.SignInAnonymouslyAsync();
    4. }
    5. RemoteConfigService.Instance.FetchConfigs(new userAttributes(), new appAttributes());
    I'm using Unity 2020.3.40f1, and tested Remote Config 3.1.3 and 3.3.1. Also, tested with/without ENABLE_CLOUD_SERVICES_ANALYTICS define. All result are same.

    I setup Game Override with all Existing Players audience. So that I guess that above Unity internal event "userAssignment" is triggered when user assigned my Game Override campaign. ("userAssignment" event automatically assigns a player to a campaign for reporting.)

    Finally, there is hardly defined pluginVersion "3.1.3" in the com.unity.remote-config-runtime ConfigManagerImpl.cs. And int the constructor, RemoteConfigRequest created with this code(there is similar code in the ConfigManagerImpl2x.cs too):

    Code (CSharp):
    1. _remoteConfigRequest = new RemoteConfigRequest
    2. {
    3.     projectId = Application.cloudProjectId ?? "",
    4.     userId = "",
    5.     isDebugBuild = Debug.isDebugBuild,
    6.     configType = "",
    7.     playerId = "",
    8.     analyticsUserId = "",
    9.     configAssignmentHash = null,
    10.     packageVersion = pluginVersion + "+RCR",
    11.     originService = originService,
    12. };
    Because the client version of "3.1.3+RCR" is very peculiar, I guessed that the problem might have something to do with this code, but I couldn't find anything more that I could do.

    Thanks for reading my long post:)
     
    Last edited: Feb 1, 2023
  2. RandolfKlemola

    RandolfKlemola

    Unity Technologies

    Joined:
    May 1, 2020
    Posts:
    130
    Hi aronze_unity,

    Thanks for reaching out! This is an incredibly detailed bug report, we REALLY appreciate that. You've identified a known issue that is being worked on as we speak. As you've mentioned, the userAssignment event is sending the wrong clientVersion value. It should be the Application Version, however, it is sending the Remote Config package version.

    Please keep 'em coming I can't get enough of amazing posts like this. Thanks!

    Best,
    Randy
     
  3. RandolfKlemola

    RandolfKlemola

    Unity Technologies

    Joined:
    May 1, 2020
    Posts:
    130
    Hi again aronze_unity,

    The issue regarding the clientVersion for userAssignment events has been fixed. Please let me know if you still see the issue occurring!

    Best,
    Randy