Search Unity

Question Custom events aren't logged every 4th of our weekly playtests

Discussion in 'Unity Analytics' started by keatonfs, Nov 24, 2021.

  1. keatonfs

    keatonfs

    Joined:
    Feb 23, 2021
    Posts:
    12
    We have weekly playtests and use the analytics from these playtests to help with designing our game. Around every 4 playtests our custom events are not logged (general metrics like MAU, DAU are always logged). It seems like this is because we get signed out from Unity Services from within the Unity Editor, so our builds aren't connecting properly and logging our custom events to Unity Services.

    Is anyone aware of reasons this may be happening? Most recently, I verified that we were signed into Unity Services when building the game and yet we still didn't get any custom events.
     
  2. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    Are you using legacy Analytics? If so, log out in the editor and then build, the build will not send events. You can use a network traffic analyzer, such as Charles Proxy to confirm if the Analytics events are being sent from the build:
    https://www.charlesproxy.com/
    https://support.unity3d.com/hc/en-us/articles/115002917683-Using-Charles-Proxy-with-Unity
     
  3. unity_Ctri

    unity_Ctri

    Unity Technologies

    Joined:
    Oct 20, 2020
    Posts:
    81
    To build on what Sam said above - if you're using the new Unity Gaming Services analytics suite, check out the Event Browser and look for invalid events. If things are showing there, then there should be more detail about why your events aren't being accepted.

    If, alternatively you're using UGS Analytics and things aren't showing up in the event browser for your userID, then it suggests the events aren't always being recorded.
     
  4. keatonfs

    keatonfs

    Joined:
    Feb 23, 2021
    Posts:
    12
    I do believe we are using the legacy Analytics (we began using whatever the main version was in September 2021). Our Unity version is 2019.4.30f.

    I checked the AnalyticsResult for each CustomEvent and they are all "Ok." I also used Charles and verified that the Analytic events are being sent. Despite trying what has worked in the past, signing out and signing back in before building, we still have not received any events on our analytics page.

    I often get signed out of Unity Services and am presented with a warning in the Services tab in the editor saying: "You do not have permission for this action." followed by the message "No network connection :(" Refreshing the Services tab doesn't fix this and I have to restart Unity to get signed back in.
     
  5. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please share your Charles proxy .chls file here (or send it in a private message). I'll take a look.
     
  6. keatonfs

    keatonfs

    Joined:
    Feb 23, 2021
    Posts:
    12
    Charles now shows that all of our requests to Unity fail. I think the issue is with the Services tab in the Unity Editor. We keep getting signed out of Services from within the Editor where we are building. There is no warning that you get signed out. I am unable to sign back in either. The Services tab either get stuck on the "No network connection :(" page or never finishes loading your organizations to link an existing project. I've tried reloading several times and nothing changes. Even when restarting Unity and Unity Hub the Services tab does not allow us to sign in.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    If you want to share your Charles capture, I can likely tell you what is happening.
     
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I was able to read the capture, thank you for providing. What those red X's mean is that you haven't properly configured Charles Proxy. You'll need to add the root certificate from the Help/SSL Proxying... menu in Charles and place it according to the article, and reboot. Then set the proper wildcard settings for the Unity endpoints. I assume this is in the Unity Editor? If so, then try again after the certificate is in place and the SSL settings. The red X's should now be gone. They don't mean you don't have network access, it's just a Charles configuration issue. And I might suggest that you send the capture via private message and remove the post above, the capture can expose local IP addresses.
     
    keatonfs likes this.
  9. keatonfs

    keatonfs

    Joined:
    Feb 23, 2021
    Posts:
    12
    I am using a Mac and there isn't any instructions for how to add the root certificate. Is this only possible on Windows?
     
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Just install the certificate from the Charles help menu
     
  11. keatonfs

    keatonfs

    Joined:
    Feb 23, 2021
    Posts:
    12
    Ok, I was able to get the analytics working again, we are receiving events. However, the solution was restarting Unity several times until eventually the Services tab in the editor had us signed in. Do you eventually get signed out of Unity Services if you leave the editor open for too long (more than a month)? It is frustrating to randomly get logged out and not know until we realize our analytics weren't recorded.
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    More than a month? Typically when I run into connection issues on my system, I reboot within a few minutes to test. The Charles capture would show why you are getting logged out, but you haven't shared it. It could be a proxy or firewall issue.