Search Unity

  1. Unity 2018.3 is now released.
    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. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Funnel Analyzer for time spent in panel

Discussion in 'Unity Analytics' started by Vasilis62, Nov 12, 2018.

  1. Vasilis62

    Vasilis62

    Joined:
    Nov 2, 2018
    Posts:
    7
    Good day everyone.

    I am having some trouble understanding how to utilize funnels. I want to track how much time a user spends on a specific panel. So, I created two scripts, one OnEnable() and one OnDisable(), with a custom event on each that sends the time since that panel appeared. Here is the code for the OnEnable() with the other being similar, besides the name of the parameters:

    public class PopupAppearEvent : MonoBehaviour
    {
    private const string ApName = "popupAppear";
    private Dictionary<string, object> parameterAp = new Dictionary<string, object>();
    void OnEnable()
    {
    string ApName = "popupAppear";
    //parameterAp.Add("ApTime", Time.deltaTime);
    //parameterAp.Add("ApTime", Time.time);
    parameterAp.Add("ApTime", Time.realtimeSinceStartup);
    AnalyticsEvent.Custom(ApName, parameterAp);
    }
    }

    So afterwards, I went to my dashboard to create a funnel with two steps, one being the ApTime (the time the panel appears) and the other being the DisTime (the time the panel disappears), which results on the screenshot I provide below. Is there a way to put them on the same line in the chart, as in starting with ApTime and ending up on DisTIme on the same line?

    Thanks in advance
     

    Attached Files:

  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    2,804
  3. Vasilis62

    Vasilis62

    Joined:
    Nov 2, 2018
    Posts:
    7
    I see. Can't I make an event to subtract the time OnEnable() from the time OnDisable() and send that?
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    2,804
    I simply meant to include the elapsed time in a single event, and not send two events, one with a start time and one with the end time. How you calculate the elapsed time is up to you.
     
  5. Vasilis62

    Vasilis62

    Joined:
    Nov 2, 2018
    Posts:
    7
    I understand, thank you very much!