Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Incorrect sent of custom events

Discussion in 'Unity Analytics' started by Egor_Letov, May 28, 2018.

  1. Egor_Letov

    Egor_Letov

    Joined:
    Dec 8, 2014
    Posts:
    5
    Hi, I got the problem when user events are sent incorrectly.

    Steps for reproduce:

    1. Create new project
    2. Enable Analytics in Services
    3. Create simple script and attach to gameobject in scene
    Code (CSharp):
    1.  
    2. public class TestAnalytics : MonoBehaviour {
    3.     void Start ()
    4.     {
    5.         StartCoroutine(TestCustomEvents());
    6.     }
    7.  
    8.     private IEnumerator TestCustomEvents()
    9.     {
    10.         yield return null;
    11.         Analytics.CustomEvent("test", new Dictionary<string, object>() {{"step", 1}});
    12.         Analytics.CustomEvent("test", new Dictionary<string, object>() {{"step", 2}});
    13.         yield return new WaitForSeconds(1.0f);
    14.         Analytics.CustomEvent("test", new Dictionary<string, object>() {{"step", 3}});
    15.         yield return new WaitForSeconds(0.2f);
    16.         Analytics.CustomEvent("test", new Dictionary<string, object>() {{"step", 4}});
    17.         Analytics.CustomEvent("test", new Dictionary<string, object>() {{"step", 5}});
    18.         Analytics.CustomEvent("test", new Dictionary<string, object>() {{"step", 6}});
    19.         yield return new WaitForSeconds(0.5f);
    20.         Analytics.CustomEvent("test", new Dictionary<string, object>() {{"step", 7}});
    21.         Analytics.CustomEvent("test", new Dictionary<string, object>() {{"step", 8}});
    22.         yield return new WaitForSeconds(0.1f);
    23.         Analytics.CustomEvent("test", new Dictionary<string, object>() {{"step", 9}});
    24.         yield return new WaitForEndOfFrame();
    25.         Analytics.CustomEvent("test", new Dictionary<string, object>() {{"step", 10}});
    26.     }
    27. }
    4. After run, you can see incorrect events in Validator:
    https://yadi.sk/i/GC4wypLp3WckKW

    In event manager on the Dashboard: https://yadi.sk/i/XSFYllfY3WcmY4

    I already reporting this bug: https://fogbugz.unity3d.com/default.asp?1042903_sl5kcl8t4an5ioe6

    I can reproduce this issue in Unity 2017.2.1f1 and Unity 2018.1.1f1

    What's happening?
     
    Last edited: May 28, 2018
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    2,235
    We may cache events so they don't always get sent immediately. You may find that some events are sent during the next session. For example, if you don't have an internet connection, we will cache all events and send them the next time you have connectivity. Similarly we may cache events if the device or network is busy.
     
  3. Egor_Letov

    Egor_Letov

    Joined:
    Dec 8, 2014
    Posts:
    5
    Sorry, but the issue is not this.
    For example, I created a funnel with these events. I ran this script several times. And the funnel doesn't work, because some events are lost.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    2,235