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”:
using UnityEngine;
using Unity.Services.Core;
using System.Collections.Generic;
using Unity.Services.Analytics;
using Unity.Services.Core.Environments;
using UnityEngine.Analytics;
public class MyAnalytics : MonoBehaviour
{
async void Start()
{
try
{
var options = new InitializationOptions();
options.SetEnvironmentName("development");
await UnityServices.InitializeAsync(options);
List<string> consentIdentifiers = await AnalyticsService.Instance.CheckForRequiredConsents();
}
catch (ConsentCheckException e)
{
Debug.Log(e);
}
}
public static void SendEvent(string eventName)
{
Analytics.CustomEvent(eventName);
}
public static void SendEvent(string eventName, string paramName, object paramValue)
{
AnalyticsService.Instance.CustomData(eventName, new Dictionary<string, object>
{
{ paramName, paramValue }
});
}
}
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: