Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question Custom events not arriving to dashboard

Discussion in 'Unity Analytics' started by mrCharli3, Jan 7, 2023.

  1. mrCharli3

    mrCharli3

    Joined:
    Mar 22, 2017
    Posts:
    982
    I setup a custom event with an int parameter, I now try to send an event like so:
    MyAnalytics.SendEvent("worldObjectPlaced", "woId", worldObject.data.id);
    . But nothing seems to happen.

    Here is my analytics "manager":


    Code (CSharp):
    1. using UnityEngine;
    2. using Unity.Services.Core;
    3. using System.Collections.Generic;
    4. using Unity.Services.Analytics;
    5. using Unity.Services.Core.Environments;
    6. using UnityEngine.Analytics;
    7.  
    8. public class MyAnalytics : MonoBehaviour
    9. {
    10. async void Start()
    11.     {
    12.         try
    13.         {
    14.             var options = new InitializationOptions();
    15.             options.SetEnvironmentName("development");
    16.             await UnityServices.InitializeAsync(options);
    17.  
    18.             List<string> consentIdentifiers = await AnalyticsService.Instance.CheckForRequiredConsents();
    19.         }
    20.         catch (ConsentCheckException e)
    21.         {
    22.             Debug.Log(e);
    23.         }
    24.     }
    25.  
    26.     public static void SendEvent(string eventName)
    27.     {
    28.         Analytics.CustomEvent(eventName);
    29.     }
    30.  
    31.     public static void SendEvent(string eventName, string paramName, object paramValue)
    32.     {
    33.         AnalyticsService.Instance.CustomData(eventName, new Dictionary<string, object>
    34.             {
    35.                 { paramName, paramValue }
    36.             });
    37.     }
    38. }
    39.  
    I keep reading that X and Y is deprecated, use
    AnalyticsService.Instance
    instead but doesnt seem to work.

    I activate debugging and this is my log:
    upload_2023-1-7_16-55-25.png

    upload_2023-1-7_16-55-40.png
     
    Last edited: Jan 7, 2023
    YogeshBeniwal likes this.
  2. RandolfKlemola

    RandolfKlemola

    Unity Technologies

    Joined:
    May 1, 2020
    Posts:
    130
    Hi mrCharli3,

    Are you still seeing this behavior? Let me know and I'll work it out with you.

    Best,
    Randy