Hi!
I’m learning to use unity services and I’m trying to put analytics in my application, but I always come across Error 404.
I think it must be something simple I missed. Sorry
Hi!
I’m learning to use unity services and I’m trying to put analytics in my application, but I always come across Error 404.
I think it must be something simple I missed. Sorry
using Unity.Services.Analytics;
using Unity.Services.Core;
using UnityEngine;
namespace Sandbox.ThirdParty.DyoSDK.UnityAnalytics.Scripts
{
public class InitUnityAnalytics : MonoBehaviour
{
async void Start(){
var consentIdentifier = "";
var isOptInConsentRequired = false;
try
{
await UnityServices.InitializeAsync();
var consentIdentifiers = await AnalyticsService.Instance.CheckForRequiredConsents();
if (consentIdentifiers.Count > 0)
{
consentIdentifier = consentIdentifiers[0];
isOptInConsentRequired = consentIdentifier == "pipl";
}
if (isOptInConsentRequired)
{
AnalyticsService.Instance.ProvideOptInConsent(consentIdentifier, false);
}
}
catch (ConsentCheckException e)
{
Debug.Log("Error reason = " + e.Reason.ToString());
}
}
}
}
Hi dyyonisio,
Thanks for reaching out! Is this issue still occurring? Is this then only analytics code you have in your scripts? Are you trying to send any custom events?
Thanks!
Randy