Search Unity

Question Why don't I receive Custom Events?

Discussion in 'Unity Analytics' started by Damwx, Sep 26, 2022.

  1. Damwx

    Damwx

    Joined:
    Sep 26, 2022
    Posts:
    4
    Hello everyone.

    I am currently experiencing a problem with Unity Analytics.
    I try to use Custom Events by following the recommended steps but I don't get any custom events, only the default events.

    Here is an example of the problem with one of my custom events.
    I created the custom event in the Event Manager and enabled it.
    UnityForum_Ex01.png

    By script I used the example that is given to trigger the custom event.
    Code (CSharp):
    1.     private void OnEnable()
    2.     {
    3.         Debug.Log("Start game and raise analytics custom event -> [" + m_AnalyticsCustomEventName + "]");
    4.  
    5. #if ENABLE_CLOUD_SERVICES_ANALYTICS
    6.         Analytics.CustomEvent(m_AnalyticsCustomEventName);
    7.         Debug.Log(Analytics.CustomEvent(m_AnalyticsCustomEventName));
    8. #endif
    9.     }
    Debug logs return :

    After a few minutes, in Event Browser, I only see the default events like gameStarted or gameRunning but none of my custom events. Why? Did I miss something?

    For information I am on Unity 2018.4.36f1 and I use Anaytics Library package v3.2.2 (I don't use the v3.2.3 because it doesn't work correctly on this version of Unity)

    If you need more information, don't hesitate to ask.

    Thank you.
     
  2. clarec_unity

    clarec_unity

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    47
    Hi @Damwx,

    The code you showed for Unity's Legacy Analytics solution; the code you're looking for is
    Code (CSharp):
    1. AnalyticsService.Instance.CustomData("myEvent", parameters);
    You can find more info on recording custom events here.

    Hope this helps!

    Clare
     
    Julian-Unity3D likes this.
  3. Damwx

    Damwx

    Joined:
    Sep 26, 2022
    Posts:
    4
    Thank you for your answer.

    When i check the documentation, I see that the minimum version of Unity for the SDK is Unity 2019.4.
    sdk_analytics.png

    My project is on Unity 2018.4.36f1, so i can't use AnalyticsService.

    What do I need to do to use unity analytics on this version of Unity? Is it still possible to use Unity Analytics on this version?
     
  4. clarec_unity

    clarec_unity

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    47
    Sorry missed that you're on 2018. Yes you're right about the SDK support, its not possible to use it on version less than 2019.4.

    Just to confirm you're currently using Legacy Analytics where you already have custom events defined and you're wanting to upgrade to UGS Analytics, is that correct? We are working on offering support for this workflow in the near future which won't require upgrading to the new SDK to use your existing custom events in UGS Analytics.

    But right now there isn't a solution for your situation that if you're not able to upgrade to Unity 2019.4 on your project.

    Thanks,
    Clare
     
  5. Damwx

    Damwx

    Joined:
    Sep 26, 2022
    Posts:
    4
    I understand, thank you.

    Do you know when it will be available?
     
  6. clarec_unity

    clarec_unity

    Unity Technologies

    Joined:
    Nov 17, 2020
    Posts:
    47
    Can't promise anything but most likely in the next month or two. We'll be sure to post updates in the forum!
     
    Julian-Unity3D likes this.
  7. Damwx

    Damwx

    Joined:
    Sep 26, 2022
    Posts:
    4
    OK, thank you for your answers!