Custom Events Never Appearing in Event Browser

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!

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.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:

```csharp
// Send custom event
Dictionary<string, object> parameters = new Dictionary<string, object>()
{
    { "fabulousString", "hello there" },
}
AnalyticsService.Instance.CustomData("friendInvited", parameters);

// Optional - You can call Events.Flush() to send the event immediately
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)

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.

1 Like