Search Unity

No custom event visible in the Dashboard

Discussion in 'Unity Analytics' started by fouratj, Aug 11, 2020.

  1. fouratj

    fouratj

    Joined:
    Sep 20, 2019
    Posts:
    9
    Hi there,

    I'm trying to add analytics for our project, and up until now i wasn't able to succefully display the events i'm sending into the dashboard and i'm wondering if there's an extra steps i'm missing

    - As for now i have my Analytics service enabled
    - I Added some custom events via script
    - The results of my different requests are OK
    - With all that no event is showing up in the dashboard

    I also tried to send event with the event tracker but still no result

    Here's a code example of my custom events

    Code (CSharp):
    1.    
    2. private void Awake()
    3.     {
    4.         Debug.Log(Analytics.initializeOnStartup.ToString());
    5.        
    6.         sessionId = AnalyticsSessionInfo.sessionId;
    7.         SendSessionInfo();
    8.     }  
    9.  
    10.     public void SendSessionInfo()
    11.     {
    12.         userId = AnalyticsSessionInfo.userId ;
    13.  
    14.         Analytics.CustomEvent("Session", new Dictionary<string, object>
    15.         {
    16.             { "sessionId", sessionId },
    17.             { "userId",userId },
    18.             { "session state",AnalyticsSessionInfo.sessionState },
    19.             { "machine", SystemInfo.deviceName },
    20.         });
    21.     }
    22.  
    23.  
    24. void Update()
    25.     {
    26.         FPSCounter();
    27.  
    28.         heartbeatTimer += Time.deltaTime;
    29.         if(heartbeatTimer>updateRateSeconds)
    30.         {
    31.             HeartBeat();
    32.             heartbeatTimer = 0f;
    33.         }
    34.     }
    35.  
    36.  
    37.   public void HeartBeat()
    38.     {
    39.         AnalyticsResult result = Analytics.CustomEvent("HeartBeat", new Dictionary<string, object>
    40.         {
    41.             { "sessionid", sessionId },
    42.             { "fps",  fps },
    43.            
    44.         });
    45.         Debug.Log("AnalyticResult : "+ result);
    46.     }
    upload_2020-8-11_7-45-41.png

    upload_2020-8-11_7-43-44.png
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    It takes our system 8-16 hours to process new events, so give it a bit more time. Your code looks correct.
     
  3. Kotzman

    Kotzman

    Joined:
    Oct 12, 2013
    Posts:
    5
    I am also not seeing custom events show up in the dashboard and can't figure out what I'm doing wrong!

    - Analytics is enabled
    - Using custom events in code
    - AnalyticsResult is OK
    - Testing in just the Editor
    - On Unity 2019.7.41f
    - Waited three days for the events to show up in the dashboard, nada
    - Here's a code snippet of one of the events I've sent:

    Code (CSharp):
    1.     public void showStoreScreen()
    2.     {
    3.         if (showing_screen)
    4.             return;
    5.         panel_animator.SetTrigger("slide_in_left");
    6.         showing_screen = true;
    7.         AnalyticsResult result = AnalyticsEvent.Custom("store_open", null);
    8.         Debug.Log(result);
    9.     }
    Any ideas?
     
  4. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    Looks like you have opened a Zendesk ticket, and I see the event "store_open" displayed on the dashboard now.
     
  5. Kotzman

    Kotzman

    Joined:
    Oct 12, 2013
    Posts:
    5
    I must be looking at the wrong thing or doing something really dumb then. I am looking under the "Event Manager" in the correct project, and I see nothing.

    upload_2020-8-21_11-11-35.png

    What am I missing?
     
  6. Kotzman

    Kotzman

    Joined:
    Oct 12, 2013
    Posts:
    5
    Oh wait I see the events as parameters in the Data Explorer! I guess I'm confused as to what's supposed to show up in the Event Manager then.
     
  7. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    You can see the list of custom events on Event Manager, it may take some time for the event to be displayed on Event Manager page, and now I can see those events have already displayed on it.


    upload_2020-8-24_17-17-8.png
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Also, make sure you are not running any ad blockers in your browser, I've heard reports that it can affect the display of events in Event Manager. But I too see the list of your events, including store_open in both Event Manager and Data Explorer (as events not parameters)
     
    azporispo and Barry0 like this.
  9. Kotzman

    Kotzman

    Joined:
    Oct 12, 2013
    Posts:
    5
    Ahhh yes uBlock Origin on Chrome was preventing those events from showing up in the Event Manager! Turned it off and I see them just fine. Thanks for the help!
     
  10. LicketyCut

    LicketyCut

    Joined:
    Aug 13, 2015
    Posts:
    4
    Ok, I am not using any kind of blocker on my browser.

    The only time that an event showed up was before I used a String Builder to actually create and send an Object. Initially I had just tried to send the List and received "System.Collections.Generic.List`1[G+MoveData]" in the dashboard.

    Now I am string building and sending the string as object but the event dashboard shows no update even after 48 hours.

    My Analytics result returns "AnalyticsResult.Ok".

    Am I missing something?

    Code (CSharp):
    1.         if (scorePercentage > 100)
    2.         {
    3.             title.text = "YOU BEAT THE\nHIGH SCORE!";
    4.             commentaryString = "WE HAVE RECORDED\nYOUR SCORE AND IT WILL\nBECOME THE NEW GOAL!\nCONGRATULATIONS!";
    5.             commentary.color = new Color(0f, 0.75f, 0.375f);
    6.             //#if !UNITY_EDITOR
    7.             string customEventName = CustomEventName();
    8.             string moveData = MoveDataAsString();
    9.             AnalyticsResult ar = Analytics.CustomEvent("BetterThanGoal", new Dictionary<string, object>
    10.                 {
    11.                     { customEventName, moveData }
    12.                 });
    13.                 Debug.Log(customEventName + "\n" + moveData.);
    14.                 Debug.Log("Result is " + ar.ToString());
    15.  
    16.             }
    17.             //#endif
    18.             GPGManager.UnlockAchievement(GPGSIds.achievement_beat_the_high_score);
    19.         }
     
    Last edited: Apr 9, 2021
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @LicketyCut I might suggest to build your dictionary object first, then use it in the CustomEvent call. Might make your debugging easier. That's why you received the strange object string in the event parameter. I might suggest sending a few "hello world" events to confirm, but we may be experiencing a processing delay at this time. I've heard of other similar reports. I would highly recommend not sending events in a for loop, nor sending events in Update or FixedUpdate. You generally only want to send a single event upon a user action, like completing a level.

    AnalyticsResult ar = Analytics.CustomEvent("HelloWorld");
     
    Last edited: Apr 10, 2021
  12. LicketyCut

    LicketyCut

    Joined:
    Aug 13, 2015
    Posts:
    4
    @JeffDUnity3D

    I appreciate your response but it really misses the point.

    Of course, I can send a simple "Hello World" event, all that takes is following the sample code. What I had hoped to do was store a string that I have built recording the moves made by the rare player that completes a level in a more efficient path than I knew was possible. The string is built efficiently and concisely.

    I have tried many techniques, all of which fail. The reason that I had implemented the loop was to be sure than my string wasn't longer than the 500 byte limit, as I said it would be a rare event with an efficient, concise string but could push that limit and two events split into smaller chunks that meet the limitations seems fair and acceptable.

    I clearly would not send an event in an Update. The data is compiled and sent on a static, end of level, leaderboard display canvas screen. I have published many games and rarely ever used a MonoBehaviour Update method for anything much less string building or sending data synchronously!

    Also, what would building the dictionary first have to do with anything? My debug code reflects the content of the Dictionary and the AnalyticsResult code is returned OK, not "NotInitialized, AnalyticsDisabled, TooManyItems, SizeLimitReached, TooManyRequests,InvalidDatavalue or UnsupportedPlatform" all of which leads me to believe that the data was sent successfully.

    Sadly it seems that Unity CustomEvents aren't up to the task that I had hoped for and/or iffy at best. I have installed Firebase Database and it took 5 minutes to write and test code that is working correctly.

    Thanks for your time though.
     
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You are welcome! The Hello World comment was to allow you to remove all variables and directly time a basic event to ensure you are not seeing processing delays at our end. Building the object first would allow you to more easily debug, and for my understanding. Your logic sent an incorrect string as you mentioned and would not be expected to generate an error, it was a legitimate string. You can use Charles Proxy also to debug over the wire https://support.unity.com/hc/en-us/articles/115002917683-Using-Charles-Proxy-with-Unity
     
  14. azporispo

    azporispo

    Joined:
    Jul 19, 2012
    Posts:
    4
    I also could not see my parameters previously defined. I was using Brave browser. After turning off the ads blocking I could see the parameters again.