Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Unity Analytics Service activated, but not working until turned off and on again

Discussion in 'Unity Analytics' started by HerrPascal, Jul 8, 2020.

  1. HerrPascal

    HerrPascal

    Joined:
    Apr 29, 2020
    Posts:
    7
    Hello there,
    I've got a problem with the Unity Analytics service. Despite being activated as a service, the code surrounded by #if UNITY_ANALYTICS does not compile. (See screenshots below)




    Now when I turn Analytics off and on again - it does compile. (toggle off / toggle on)



    I can't figure out what's the problem here and it's really problematic for automated jenkins/buildserver builds, because there is no manual analytics service off and on option. Unity Version for this example is 2018.2.20f1, but I was able to reproduce this on some other 2018.x.x Unity versions.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Your work around is correct. Once you toggle the service as you suggest and Save the project, Analytics should stay enabled. Specifically the steps are:

    * Make a back up of your project
    * Open the project in Unity
    * Disable Analytics, Save the project, and exit Unity
    * Reopen the project
    * Enable Analytics, and Save the project
    * Done! Analytics should now be properly enabled
     
  3. HerrPascal

    HerrPascal

    Joined:
    Apr 29, 2020
    Posts:
    7
    @JeffDUnity3D Thank you for the confirmation of the problem and that the workaround is valid.
    Now this is still a problem for automated builds on a server, since I copy the repository to the server and then start a silent build in unity. Is there any workaround for this, too?
     
    Last edited: Jul 9, 2020
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Not that I'm aware of, and I would not expect an update any time soon.
     
  5. acakebread

    acakebread

    Joined:
    Jul 11, 2016
    Posts:
    12
    I have implemented Analytics on my project and activated the system. The start up events eventually started coming through after around 18 hours but apart from that absolutely nothing. I have added the Analytics Event Tracker both in the inspector and in code and set up the most basic possible custom events and nothing whatsoever works. I have also tried running the app both in the editor and on the device (Android). I have to say this is the most pathetic analytics system I have ever seen. Who makes a system that takes that long to register an event. I have used others in the past that are virtually instant, Unity expects you to wait 18 hours for events to filter through. How are you supposed to develop a system with a testing turnaround on tidal scale timelines? What are they doing sending the messages by snail mail or something? I have been aware that Unity has been trying to encourage people to use their system for quite some time but I had avoided it in the past because the analysis tools were simply not at the standard required but I thought after all this time they would have got this refined but I am very disappointed to say that I can't see that this system is even fit for purpose. I am going to give it a few more hours to see if finally any events finally make it through or someone responds to me with any suggestion on how to make this carbuncle work. Failing that I'll pull it and find a system that actually works
     
    Last edited: Oct 24, 2021
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Good news! We have a whole new Analytics system that we just released this week, this should help you get started https://support.unity.com/hc/en-us/articles/4408915768724-General-FAQ This system can process incoming events in 1-2 hours, a huge improvement over our previous system. So you know, the original Analytics system was experiencing long delays just this week, so that is what you were likely seeing, and is not typical. 8-16 hours for the original system is the expected wait time, compared to 1-2 hours now.
     
    acakebread likes this.
  7. acakebread

    acakebread

    Joined:
    Jul 11, 2016
    Posts:
    12
    OK thank you for taking the trouble to reply. I had seen the new SDK notifications but I couldn't work out what to do. At least this post seems to contain some instructions. I'll give it a try but I am running out of time now. I need to get this done. If I have to wait another 24 hours to see if any of what I am doing is actually working it will be too late. I was supposed to have this finished by the end of the weekend. Let's just hope this isn't as completely useless as the existing implementation, which quite frankly, beggars belief
     
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    If you could, please send me your ProjectID in a private message and I can check on the status. One note, ad blockers in your browser can prevent the data from showing. Please try with a different browser too.
     
  9. acakebread

    acakebread

    Joined:
    Jul 11, 2016
    Posts:
    12
    I am sorry, what language are you referring to? There is nothing here that anyone anyone could possibly take offence to. Are you suggesting people are not allowed to criticise woefully inadequate systems? I will contact you as requested with the ProjectID
     
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    @acakebread Agreed, let's focus on the issue. I will look forward the ProjectID. Were you able to check for ad blockers?
     
    acakebread likes this.
  11. acakebread

    acakebread

    Joined:
    Jul 11, 2016
    Posts:
    12
    I have contacted you as requested. Thank you
     
  12. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    I am seeing data begin to appear on your dashboard, and see the event "[screen] MainMenu" . One note, we typically don't see bracket characters [ ] in event names, or spaces. You might consider them similar to database field names, many of our customers do just that and import the events into a local database. Also, now would be a good time to try out the Analytics Beta!
     
  13. acakebread

    acakebread

    Joined:
    Jul 11, 2016
    Posts:
    12
    OK thanks for the help. It's a shame that that is the only message you have seen because that was sent well over 24 hours ago. All events today (sent via script) have consisted of uppercase '[SCREEN]'. I will take on board and fully adopt your suggestions regarding naming standards when I fully implement the system. I still need to see some events make it through from today.

    UPDATE: I have changed all the events to follow the CamelCase convention and removed the brackets.. All new events should be consistent with your advice
     
    Last edited: Oct 24, 2021
  14. acakebread

    acakebread

    Joined:
    Jul 11, 2016
    Posts:
    12
    OK so a further 12 hours later and I am still not seeing any custom events whatsoever and this is after switching over to the new 'improved' beta program. After three days of fiddling around I am actually in disbelief how completely unusable this feature is. In the past I have added, tested and completed analytics systems inside one hour. What on earth is going on here!
     
  15. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide sufficient information for us to troubleshoot. Are you receiving the green logs in the console window that the events are sent? What is the ProjectID? Please describe the behavior that you are seeing now, perhaps share the code you are using, and screenshots. We have customers using the product without issue and seeing their events in 1-2 hours. My dashboard looks like this to create MyEvent

    CustomEvent2.png

    CustomEvent.png
     
  16. acakebread

    acakebread

    Joined:
    Jul 11, 2016
    Posts:
    12

    The project ID is the same one I sent you yesterday..

    the code I am using is this (note: it is definitely called because the entire app relies on this, also not the analytics initialisation in Awake as instructed).. I have not seen any green log or otherwise. There is no feedback whatsoever from the analytics system.

    public class AppController : MonoBehaviour
    {
    public AppSection startSection;

    private static Dictionary<string, AppSection> map = new Dictionary<string, AppSection> ();

    void Awake() { UnityServices.InitializeAsync(); foreach (var section in FindObjectsOfType<AppSection> (true)) { map[section.name] = section; section.gameObject.SetActive (false); } }

    void Start() => ShowSection (startSection);

    private static AppSection activeSection;
    public static AppSection ShowSection(AppSection section)
    {
    activeSection?.gameObject.SetActive (false);
    activeSection = section;
    //UnityEngine.Analytics.Analytics.CustomEvent("[SCREEN] " + activeSection?.name);
    Events.CustomData("landOnScreen", new Dictionary<string, object>() { { "screenName", activeSection?.name } });
    activeSection?.gameObject.SetActive (true);
    return activeSection;
    }

    public static AppSection GetSection(string section) { return true == map.ContainsKey(section) ? map[section] : null; }
    public static AppSection ShowSection(string section) { return ShowSection(true == map.ContainsKey(section) ? map[section] : null); }
    }
     
  17. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    @acakebread How are you debugging? Please place Debug.Log statements in this code to confirm that it's being executed as expected. And to see the satisfyingly green log output, add the following as a Scripting Define Symbol under Player Settings/Other Settings

    UNITY_ANALYTICS_EVENT_LOGS

    You have configured your events on your dashboard as in my screenshots, correct?
     
    EdwinOlima likes this.
  18. acakebread

    acakebread

    Joined:
    Jul 11, 2016
    Posts:
    12
    I am sorry, did you say I have to configure the events on the dashboard? Are you serious? Does this system only work if you tell it what to expect? I am going to have to abandon this. It's truly not fit for purpose. I have never seen anything like it. Someone at Unity needs to look at this properly before everyone stops using it. Thanks for your your help but it's back to Google Analytics for me
     
  19. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, the prior configuration on the dashboard allows us to quickly process and validate the events. A quick check on their website states "Google analytics takes up to 24 hours for the data to appear." I don't have personal experience with the product, however. This upgraded version of Analytics is the result of the collaboration between deltaDNA and Unity, and we have adopted their event configuration process. We now have a rich feature set, but granted with a bit of configuration https://unity.com/products/deltadna
     
  20. acakebread

    acakebread

    Joined:
    Jul 11, 2016
    Posts:
    12
    but the problem is that I have got to hand this off and they won't want to be adding metrics in the dashboard; they won't even understand what to do. In every other analytics systems I have used the fields update themselves. If the developer adds more metrics they just appear on the dashboard. For this to work I will retain access to the console and they will be forever dependent on me to maintain it! It feels like real step backwards to me
     
    Last edited: Oct 25, 2021
  21. EdwinOlima

    EdwinOlima

    Joined:
    Jul 27, 2017
    Posts:
    9
    Yes adding the above script to Player Settings worked !! thanks.