Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Can't make it work live

Discussion in 'Unity Analytics' started by sebas77, Mar 16, 2015.

  1. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,641
    Hi,

    as far as I understood, in order to enable the event tracking from our clients, we need just to call UnityAnalytics.StartSDK(projectId) with the right projectID (in my case from a Monobehaviour like shown in the example).

    Then I use a custom event like this one:

    Code (CSharp):
    1. public static void BI_TrackFrameRate(float fps, string level)
    2.     {
    3.         fps = Mathf.Max(fps, 60.0f);
    4.         fps = Mathf.Min(fps, 0.0f);
    5.  
    6.         int min = Mathf.FloorToInt(fps / 10.0f);
    7.         int max = Mathf.CeilToInt(fps / 10.0f);
    8.    
    9.         if (max == min)
    10.             max += 1;
    11.    
    12.         string fpsBucket = (min * 10).ToString() + " - " + (max * 10).ToString();
    13.  
    14.             UnityAnalytics.CustomEvent("FrameRate",  new System.Collections.Generic.Dictionary<string, object>
    15.               {
    16.                 {"Multiplayer", true},
    17.                 {"level", level },
    18.                 {"fps", fpsBucket }
    19.               });
    20.     }
    however, while the local integration works (data is shown on your web app), all the data from the live clients seems to not be collected. Actually, no data is tracked at all (so the DAU is basically 0).

    Also, as you can see, I am tracking string values, this because I'd like to see buckets of "hits". Is that possible with the current Unity Analytics?
     
  2. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    Hey Sebastiano! We know each other via Twitter and discussions on Dependency Injection. Great to see you here.

    Let me handle your questions one-by-one.
    Since your events show up in the EventValidator, the likeliest cause of this is that you need to wait up to four hours for the data to aggregate (the validator is instantaneous, but the other charts are driven by aggregation). Check again in a bit and see if the data appears. After that, feel free to PM me with the name or ID of the app and I can look to see if there's an issue.

    The answer is "not yet", but this is currently our most-requested feature and the work is very much in progress. We hope to have this resolved in the coming weeks.
     
  3. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    Oh, one other important thing. I'd have said that frame rate reporting is possibly not the best use of Unity Analytics in the sense that you can't track it very frequently or you'll blow past your event limit, and our system is more targeted at tracking user behavior than performance. Ultimately, this is probably a job best handled by the new perf system (now in alpha) which is designed to track app performance...though I'm not sure if they've implemented FPS reporting yet:

    http://perf.cloud.unity3d.com/
     
  4. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,641
    Thanks marc!

    I think you are right, I will check the perf solution out :). I asked the permission to use it, will I find examples on how to use it?
     
  5. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
    I'm not certain. It just went into a sort of open alpha during GDC. I'll ask the guy behind it (my fellow developer of StrangeIoC, btw) to admit you.
     
  6. XilenceX

    XilenceX

    Joined:
    Jun 16, 2013
    Posts:
    122
    I have the same issue as Sebastiano since my basic editor integration works, but I'm not receiving any data from my testers via the Unity Webplayer. I waited a lot of hours already, so I've sent you a PM.
     
  7. marc_tanenbaum

    marc_tanenbaum

    Unity Technologies

    Joined:
    Oct 22, 2014
    Posts:
    637
  8. sebas77

    sebas77

    Joined:
    Nov 4, 2011
    Posts:
    1,641
    just a quick update, I do now receive data. I cannot use it to gather quality metrics, but it's ok for the rest.