Search Unity

Resolved Analytics Event not trigger (New Analytics "2.0.7-pre.7")

Discussion in 'Unity Analytics' started by MarkusUnger, Dec 13, 2021.

  1. MarkusUnger

    MarkusUnger

    Joined:
    Aug 22, 2015
    Posts:
    22
    Good morning!
    I tried to use the new Analytics Events, but I can't see it in the Event Browser.
    I'm using the new Analytics SDK:
    Bildschirmfoto 2021-12-13 um 08.21.48.png

    Added the Debugging Flag for the Script Executor:
    Code (CSharp):
    1. UNITY_ANALYTICS_EVENT_LOGS
    Here my code (based on the thread https://forum.unity.com/threads/is-analytics-customevent-supposed-to-work.1201822/):

    Bildschirmfoto 2021-12-13 um 08.32.37.png

    My console log:

    Bildschirmfoto 2021-12-13 um 08.23.58.png

    I also registered the ne custom event here:

    Bildschirmfoto 2021-12-13 um 08.25.18.png

    But do not receive the new custom event, also not in the Invalid Events, BUT receive the basic events like "gameRunning" or "sdkStart", so the Analytics should work.

    Bildschirmfoto 2021-12-13 um 08.30.55.png

    Anybody an idea what's wrong?
     
  2. chris_aitk

    chris_aitk

    Unity Technologies

    Joined:
    Jan 20, 2020
    Posts:
    2
    Hi @MarkusU, could you please send me your Unity project ID via a private message and I'll take a look at that for you.
     
    MarkusUnger likes this.
  3. chris_aitk

    chris_aitk

    Unity Technologies

    Joined:
    Jan 20, 2020
    Posts:
    2
    Hi @MarkusU, you should now be able to see the events you sent.

    I also took a look at your Event Browser and I was able to see your
    gameOver
    event was invalid and also sent to your production environment.
    markus-event-browser.png

    Could you please try re-running your code to see if your event shows up in your development environment? If you are still not seeing this event show up in the correct environment please let me know.

    You will also need to add a
    highscore
    parameter to your
    gameOver
    event for it to be considered valid.
     
    Last edited: Dec 13, 2021
  4. MarkusUnger

    MarkusUnger

    Joined:
    Aug 22, 2015
    Posts:
    22
    Thanks for you help @chris_aitk ! In the production I now the see invalid events, but only 2 from today (I think I triggered also some events yesterday).
    In the development environment are still no events/invalid events. How long should it take to see these events after trigger it in unity editor?

    In the old system the validator helps a lot to check if my event are triggered correctly. It would be great if for development the events would be receive in real time in the event browser.
     

    Attached Files:

  5. MarkusUnger

    MarkusUnger

    Joined:
    Aug 22, 2015
    Posts:
    22
    Here is my code (sure the event it invalid, because of the wrong parameter, but should be received from the event system):
    Code (CSharp):
    1. using System.Collections.Generic;
    2. using Unity.Services.Analytics;
    3. using Unity.Services.Authentication;
    4. using Unity.Services.Core;
    5. using Unity.Services.Core.Environments;
    6. using UnityEngine;
    7.  
    8. public class UGS_Analytics : MonoBehaviour
    9. {
    10.     private async void Start()
    11.     {
    12.         print("UGS Analytics");
    13.         var options = new InitializationOptions();
    14.         options.SetEnvironmentName("development");
    15.         await UnityServices.InitializeAsync();
    16.  
    17.         if (!AuthenticationService.Instance.IsSignedIn)
    18.         {
    19.             await AuthenticationService.Instance.SignInAnonymouslyAsync();
    20.         }
    21.  
    22.         HandleCustomEvent();
    23.     }
    24.  
    25.     private void HandleCustomEvent()
    26.     {
    27.         print("Handle Custom Event");
    28.         Events.CustomData("gameOver", new Dictionary<string, object>()
    29.         {
    30.             {"highscore", 123}
    31.         });
    32.         Events.Flush();
    33.     }
    34. }
     
  6. MarkusUnger

    MarkusUnger

    Joined:
    Aug 22, 2015
    Posts:
    22
    Now I received it. Does it take 6-8 Minutes to get the logs? Did you change something? Or what was the issue?
    Sure it's a beta, but it feels hard if I try something and it don't work without help from a unity member :(
     
  7. MarkusUnger

    MarkusUnger

    Joined:
    Aug 22, 2015
    Posts:
    22
    The Events
     

    Attached Files:

  8. MarkusUnger

    MarkusUnger

    Joined:
    Aug 22, 2015
    Posts:
    22
    Hey @chris_aitk ! I added a time object, to see how long it takes to receive the data in the event manger. Nearly 5 minutes.
     

    Attached Files:

  9. Laurie-Unity

    Laurie-Unity

    Unity Technologies

    Joined:
    Mar 5, 2020
    Posts:
    220
    Hi Markus,

    I'm pleased to see that your events are now visible in the Event Browser. Apologies for the confusion and delay, it does look like there was an issue on our side that delayed the processing of the events you sent earlier today. It is normal that there is a lag of 5-10 minutes from events being uploaded to being visible in the Event Browser tool.

    Your gameOver events are however, showing up in the Invalid Events page as they contain an unexpected highscore parameter. You will need to update the gameOver event definition in the Event Manager and add highscore as an Integer parameter if you want to resolve this error.

    We are really interested to hear your feedback on using the new Gaming Services, so please let us know if you run into any other issues.

    Thanks,
     
  10. MarkusUnger

    MarkusUnger

    Joined:
    Aug 22, 2015
    Posts:
    22
    Thanks a lot! Have a nice day :)
    Can be closed.