Search Unity

  1. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  2. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  3. If you couldn't join the live stream, take a peek at what you missed.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. 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:
    1,614
    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:
    1,614