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

How to use the Unity Analytics?

Discussion in 'Unity Analytics' started by ndmrzk, Apr 20, 2020.

  1. ndmrzk

    ndmrzk

    Joined:
    Jul 25, 2018
    Posts:
    35
    Hello, im using 2019.3.0f3 and i need to add in analytics in the app but ive never done it before so im confused as to what needs to be done.

    I have 4 buttons which open up an in app browser where the links are set via script (as it depends on what product was clicked.) So if were to set the analytics purely via inspector i add in the Analytics Tracker component on a button, select UI, set the Name of the custom event but then im at a lost on how to set the parameter. For the parameter there is Name and Value, the name is completely up to me i assume and the value i change it to dynamic(?) because the string value changes and depends on a script (which is on a gameobject that hold all the scripts). But for Value what do i assign? if i assign the aforementioned gameobject the dropdown list does not appear. which i where im stuch.

    if i were to set it via script can i then put it in the function (which already has the url from a differnt function) that gets triggered by the button click? something like :


    Code (CSharp):
    1. Analytics.CustomEvent("Store Link", new Dictionary<string, object>
    2. {
    3.         {"url_link",store_url}
    4. });
    got that from the unity analytics custome scripting manual. then in the unity dashboard do i Add Custome EVent with the Name Store Link?
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I would not recommend to use the Analytics Tracker component, but just use the script like you have on a regular button click event. Once you send that event from your game, the event will be visible in the Dashboard in 8-16 hours, after we process events. But probably more importantly, what do you plan to use with the URL data, etc? I would recommend to send a few events, wait the 8-16 hours, then view your Dashboard and start to make simple reports.
     
  3. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    445
    Wait.... wut? We have to wait 8-16 hours to see if an event is "sent".
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, that is correct. Our Raw Data Export however (a Pro-only license feature) is immediately available https://docs.unity3d.com/Manual/UnityAnalyticsRawDataExport.html . You might want to check out deltaDNA for new project development.
     
    devotid likes this.