Search Unity

Question Custom Events Never Appearing in Event Browser

Discussion in 'Unity Analytics' started by aaronmichaelfrost, Oct 5, 2022.

  1. aaronmichaelfrost

    aaronmichaelfrost

    Joined:
    Feb 4, 2021
    Posts:
    39
    Hi there, my custom events don't appear in the Event browser, not even under Invalid Events, even after 24 hours, in Unity 2022.1.18f1.

    I first created a custom event using UGS Dashboard Event Manager. The event name is "friendInvited".

    To fire the event, I run this code:
    AnalyticsService.Instance.CustomData("friendInvited", new Dictionary<string, object>());

    AnalyticsService.Instance.Flush();


    I know the event is firing in Unity, because I defined UNITY_ANALYTICS_EVENT_LOGS, and I see the expected output.

    My account is definitely connected to cloud services under my only project. Crash reporting and cloud builds work just fine. Also, all the non-custom events appear just fine. Querying the event in the Data Explorer also provides no data.

    Help appreciated. Thanks!
     
  2. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    192
    Hey @aaronmichaelfrost

    I'm curious as to why you've tried it like this as it's not common practice to send empty custom data.
    AnalyticsService.Instance.CustomData("friendInvited", new Dictionary<string, object>());
    AnalyticsService.Instance.Flush();


    I can possibly understand that you would like to take a shortcut.

    To send a custom event you should be recording it like this:

    Code (CSharp):
    1. // Send custom event
    2. Dictionary<string, object> parameters = new Dictionary<string, object>()
    3. {
    4.     { "fabulousString", "hello there" },
    5. }
    6. AnalyticsService.Instance.CustomData("friendInvited", parameters);
    7.  
    8. // Optional - You can call Events.Flush() to send the event immediately
    9. AnalyticsService.Instance.Flush();
    You can see this in the documentation here: Record Custom Events (unity.com)


    However, while it should still work the way you done it, and upon testing it myself multiple times, can you confirm if you have initialized it correctly? Initial setup (unity.com)
     
  3. aaronmichaelfrost

    aaronmichaelfrost

    Joined:
    Feb 4, 2021
    Posts:
    39
    The solution was to follow the initial setup. That document was pretty hard to find from the inital documentation link on UGS cloud services. Maybe a good idea to put that somewhere more obvious.

    On another note, sending empty dict worked fine because there were no custom parameters specified in EventManager.
     
    Julian-Unity3D likes this.