Search Unity

Analytics no longer working

Discussion in 'Unity Analytics' started by kenamarapala, Feb 26, 2020.

  1. kenamarapala

    kenamarapala

    Joined:
    Jun 5, 2019
    Posts:
    18
    Hello,

    While trying to debug a problem with Analytics not working with our Jenkins builds, I've noticed that Analytics for my own local builds are no longer working either, when Analytics has been working previously for both production builds from Jenkins and local workspace dev builds.

    For both our Jenkins machine and my local machine, an account is signed in and linked to our project, the Services window clearly has Analytics enabled; Jenkins also provides the username and password as command line arguments. Analytics will send fine while in Editor, but any built players attempting to send Analytics events will return with NotInitialized.

    I've also added logs to output the status of Analytics.enabled and AnalyticsSettings.enabled, both of which output to true when checked in an OnPreprocessBuild callback.

    I'm wondering if there's a setting somewhere that we haven't found that could be causing the issue?

    Possibly related to the issue, UnityConnectSettings.asset appears to have everything properly enabled for Analytics, however, the first instance of an m_Enabled property (the one that does not belong to the other Unity Services) is 0.
    notepad++_xyf2KLgvSV.png

    I was assuming this was the source of the issue, however, attempting to manually change this to 1 does not work as it seems like something in the build process forcibly sets it back to 0.

    Any help would be greatly appreciated!
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you show your code that demonstrates the Not Initialized error? Do you mean that the return code from Analytics.CustomEvent which is of type AnalyticsResult shows "Not Initialized" vs "OK" ?
     
  3. kenamarapala

    kenamarapala

    Joined:
    Jun 5, 2019
    Posts:
    18
    Sorry, yes, I was referring specifically to the return code for when we call AnalyticsEvent.Custom, which is returning AnalyticsResult.NotInitialized
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  5. kenamarapala

    kenamarapala

    Joined:
    Jun 5, 2019
    Posts:
    18
    I believed our issue was caused by the setting "Disable HW Statistics" being set to true.

    I didn't think this to be an issue to begin with as the matching property in ProjectSettings.asset (submitAnalytics: 0) hadn't been changed since 2018, as source control tells me, and Analytics had been working fine.

    For clarity, is this working as intended? Where if Analytics/Cloud Diagnostics/etc. are enabled in the Services window, those services still won't run if "Disable HW Statistics" is set to true?
    (edit: I include Cloud Diagnostics here as in this thread there's a comment by marc_tanenbaum which states "HW Statistics are the “core” stats that underlie all runtime services, including analytics", so would it be affecting CD?)

    I'm just confused about how those services were previously working when "Disable HW Statistics" has been enabled for a long time now, and I don't believe it could have been any local changes on our build machine since part of our build process reverts the workspace prior to build, in addition to no code in the pre-build steps that could change that setting.
     
    Last edited: Feb 27, 2020
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Your Analytics events would never have been expected to be sent with HW Stats disabled, so I doubt there is a recent change in behavior for you. Have you seen your events consistent in your Dashboard? I will check on what the expected behavior would be with respect to CD with this setting disabled.
     
  7. kenamarapala

    kenamarapala

    Joined:
    Jun 5, 2019
    Posts:
    18
    Everything previous to our Feb build looks normal while browsing the Data Explorer on the dashboard.

    Our Feb build would have been our third production build built using our Jenkins setup, and there's a clear drop in DAU from thousands to dozens, only starting from the Feb build. To clarify, the event data for the two builds prior to this look normal.

    And browsing through our custom events, there's a clear drop for some of the events also from thousands to the dozens, and others just have no occurrences from Feb 13 onward. I'm assuming the small number of events that are listed after that point are from builds built from developers (who have had the "Disable HW Stats" setting disabled).

    With regards to Cloud Diagnostics, I've seen that our QA builds are properly uploading reports which can be viewed from the dashboard, but there hasn't been anything seen from the production builds.
     
    Last edited: Feb 27, 2020
    JeffDUnity3D likes this.