Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

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:
    876
    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:
    118
    Hi mrCharli3,

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

    Best,
    Randy