Search Unity

Question Can't receive custom events.

Discussion in 'Unity Analytics' started by AnglerEntertainment, Sep 8, 2022.

  1. AnglerEntertainment

    AnglerEntertainment

    Joined:
    Jan 24, 2022
    Posts:
    4
    Hello,I am trying to use new analytics and send custom events, but custom events are not showing in Event Browser or Data explorer. In same time standart events such as "gameStarted" and "gameRunning" are displaying.

    I have create a custom event "installAndroidData" with a few custom(strings) parameters assigned in Event Manager. And how I use it:

    Dictionary<string, object> parameters = new Dictionary<string, object>()
    {
    { "utm_source", "TestData" }
    };
    AnalyticsService.Instance.CustomData("installAndroidData", parameters);

    In Log i can see events:

    Recorded event gameStarted at 2022-09-08 13:36:18.868 +03:00 (UTC)
    Recorded event installAndroidData at 2022-09-08 13:36:26.682 +03:00 (UTC)

    But in Event Browser or Data explorer only gameStarted showed.
    I am also try to use AnalyticsService.Instance.Flush(); - no changes.
    Please help.
     
    Last edited: Sep 8, 2022
  2. clarec_unity

    clarec_unity

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    47
    Hi there,

    Did you create the event schema for the event "installAndroidData" in the Event Manager?

    Thanks,
    Clare
     
  3. AnglerEntertainment

    AnglerEntertainment

    Joined:
    Jan 24, 2022
    Posts:
    4
    Yes it is created.
     

    Attached Files:

  4. xjjon

    xjjon

    Joined:
    Apr 15, 2016
    Posts:
    612
    How long did you wait? Sometimes it takes up to 1 day for these new custom events to show up
     
  5. AnglerEntertainment

    AnglerEntertainment

    Joined:
    Jan 24, 2022
    Posts:
    4
    This event was created and first time send about a week ago
     
    Last edited: Sep 9, 2022
  6. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    I'm experiencing the same... not seeing custom events, so I'm listening in here. It's been like 12 hours or so since I send the first. I get other events, like gameStarted etc. but not the custom ones (I have two).

    I have verified in Fiddler that they are actually send.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Ensure that you are initializing UGS Analytics first, as described here https://docs.unity.com/analytics/AnalyticsSDKGuide.html
     
  8. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    Thanks, but I am. The default analytics comes through - it's only my custom events that are missing.

    I'm sending my custom event like this:

    Code (CSharp):
    1.  AnalyticsService.Instance.CustomData("item_unlocked", new Dictionary<string, object>
    2.                 {
    3.                     { "entity_id", args.EntityId }
    4.                 });
    Screenshot_2.png
     
    Last edited: Sep 11, 2022
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Thank you for confirming. You've checked that they are not showing under the Invalid events tab? If you want to send me your dashboard URL in a private message I can check too. Can you share your Fiddler capture?
     
  10. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    Ahhhh.... I actually looked there before, but there was nothing, but there is today :)

    Screenshot_4.png
     
  11. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    So now I know why...but how do I then add that "entity_id" param, because I need that, else the event is useless.

    I have tried the "Assign Parameter" button, but it's like it's only standard params I can pick from?
     
  12. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    Ok... think I have figured it out :)
     

    Attached Files:

    JeffDUnity3D likes this.
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You can create your own parameters also. Please see https://docs.unity.com/analytics/EventManager.html where you can assign parameters from the available list or click Add New > Custom Parameter to create your own.

    CustomParam.png
     
  14. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    JeffDUnity3D likes this.
  15. AnglerEntertainment

    AnglerEntertainment

    Joined:
    Jan 24, 2022
    Posts:
    4
    Yes, it is initialized, i receive standart events and didnt receive custom, but standart events use old sdk "sdkMethod": "UA1_SDKLESS", however Analitycs 4.2.0 is installed.
     
  16. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Legacy custom events won't be sent over to the UGS Analytics dashboard, only the standard events.
     
  17. samvilm

    samvilm

    Joined:
    Jan 17, 2021
    Posts:
    43
    @JeffDUnity3D

    I installed analytics and analytics library from the package manager. upload_2022-10-27_0-20-29.png

    It only sends standard events but no custom events. The sdk is

    "sdkMethod": "UA1_SDKLESS",

    Have I installed the wrong thing?

    I'm also a little confused about the set up. Does it need code to work? Its sending the standard events without me setting up any code. If I add an Analytics Event Tracker component will it work out of the box?
     
  18. clarec_unity

    clarec_unity

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    47
    Hi @samvilm,

    Analytics Library is the package needed to define custom events for Legacy Analytics, this isn't needed to use UGS Analytics (nor is switching Analytics on in the Services window that just sends standard events on Legacy).

    For UGS Analytics, you need that package called "Analytics" to be installed and initialized - more info on initialization can be found here. Once that is done, standard events will be automatically available in UGS Analytics (should show up in Event Browser after 5 mins and up to an hour to show in dashboards/analysis tools). To define custom events they need to be defined in the Event Manager and in your game code - more info here.

    Hope this helps! If you've already done all of the above, I recommend checking the invalid tab in the Event Browser to debug or sending me over your projectID and i'll check it out for you.

    Thanks,
    Clare