Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Debugging custom events

Discussion in 'Unity Analytics' started by pottageb, Sep 6, 2022.

  1. pottageb

    pottageb

    Joined:
    May 21, 2021
    Posts:
    7
    Hello,

    I am having an issue where custom events are not showing in Event Browser on the dashboard (or via Data explorer).

    I can confirm built in events such as "gameStarted" and "gameRunning" are displaying - Why are my custom events not showing in Event Browser? How can I debug the issue?

    I am testing these through the Unity editor (awaiting Unity to allow support for WebGL builds).

    I have a custom event "switchModel" with a custom parameter "modelName" assigned:
    upload_2022-9-6_13-24-4.png

    I am queuing this event as follows:
    upload_2022-9-6_13-25-55.png

    Thank you,
    Ben
     
  2. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    191
    Do you have your Custom Event firing?
    Try putting your Custom Event on a button to test it.
    It could just be that you aren't firing the Custom Event
    If that doesn't work be sure to let me know and we'll dig a little deeper.
     
  3. pottageb

    pottageb

    Joined:
    May 21, 2021
    Posts:
    7
    Hi Julian,
    Yes, the event is firing from a button click (confirmed by debugging (hits breakpoint) through VS):
    upload_2022-9-8_8-17-3.png
    Thanks,
    Ben
     
  4. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    191
  5. pottageb

    pottageb

    Joined:
    May 21, 2021
    Posts:
    7
    Yes, please see original post and below:
    upload_2022-9-8_10-34-12.png
    (Also assigned custom parameter "modelName" to custom event).
    Thanks.
     
  6. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    191
    Just to clarify, you say you are testing in the editor. Do you have the build settings set to WebGL?
     
  7. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    191
    @pottageb Send me a DM with your project ID and I'll check your dashboard.
     
    unity_Ctri likes this.
  8. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    191
    Having a quick look over your dashboard, I can see you added payment information, but you've not Set up Analytics.
    upload_2022-9-8_11-50-3.png
    Could you hit that button for me on your dashboard and then test your project in the editor confirming if we can see anything in your Dashboard > Event Browser.
     
  9. pottageb

    pottageb

    Joined:
    May 21, 2021
    Posts:
    7
    Hi Julian,
    All steps were completed previously, the last step cannot be "completed" so the "Set up Analytics" button will (presumably?) never disappear:
    upload_2022-9-8_11-55-0.png
    Ben
     
  10. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    191
    Could you try again, I want to keep an eye on your dashboard > event browser to see what events are coming in now.
     
  11. Julian-Unity3D

    Julian-Unity3D

    Unity Technologies

    Joined:
    Apr 28, 2022
    Posts:
    191
    If this this still isn't working, we can update Analytics to a version not yet in the package manager, which does support WebGL.

    To do this, please go to your Manifest file found in your Project Name > Packages folder, find
    com.unity.services.analytics
    and amend the version number to 4.2.0 then save and close.

    This will then update the package to the latest version and allow you to use it with WebGL.
     
  12. pottageb

    pottageb

    Joined:
    May 21, 2021
    Posts:
    7
    Hi Julian,
    I had already installed 4.2.0 through package manager:
    upload_2022-9-8_13-11-12.png
    As explained, I am testing through the Unity editor (not WebGL).

    Ben
     
  13. unity_Ctri

    unity_Ctri

    Unity Technologies

    Joined:
    Oct 20, 2020
    Posts:
    81
    Hey Pottageb,

    This is quite interesting. I tested sending a custom event with 4.2.0 myself just to be on the safe side, and it was received in my project without issue.

    Can you try replacing the modelName with a fixed string value for the time being and seeing if that makes a difference?
    It certainly seems like the event isn't being sent by the SDK in the first place, which is a very unusual circumstance.
    To verify this, we'd recommend intercepting the payload with a proxy tool

    (we've a guide for using Charles Proxy here: https://support.unity.com/hc/en-us/articles/115002917683-Using-Charles-Proxy-with-Unity )

    Can you verify that the event isn't actually being sent by the SDK? This will help us narrow our search to find the cause.

    Thanks!
     
    Julian-Unity3D likes this.
  14. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  15. pottageb

    pottageb

    Joined:
    May 21, 2021
    Posts:
    7
    Julian-Unity3D likes this.