Analytics vs Unity Analytics

I am a little confuse about what I have to use. I am sure this topic has been discussed in the past but I couldn’t find additional information.

Unity Analytics:

Analytics:

I think I have to use the second one, but, in that case, what is the first one? Can I safety disabled it?
I am having these doubts because every time I try some code, it doesn’t even compile, and I don’t know if it is because I am using the wrong package, the wrong version, or maybe something else.

P.S:
I am currently trying the latest Analytics (com.unity.services.analytics | 6.0.2), and this code found in Unity Learn doesn’t work (Record user actions with Analytics events - Unity Learn)

    private void LevelCompletedCustomEvent()
    {
        int currentLevel = Random.Range(1, 4); // Gets a random number from 1-3

        // Define Custom Parameters
        Dictionary<string, object> parameters = new Dictionary<string, object>()
        {
            { "levelName", "level" + currentLevel.ToString()}
        };

        // The ‘levelCompleted’ event will get cached locally
        //and sent during the next scheduled upload, within 1 minute
        AnalyticsService.Instance.CustomData("levelCompleted", parameters);

        // You can call Events.Flush() to send the event immediately
        AnalyticsService.Instance.Flush();
    }

I assume that the problem is that the API has changed, but in the official documentation, Unity Analytics, you can not change the version to see API changes, as you can in netcode, for instance (About Netcode for GameObjects | Unity Multiplayer)

So it is difficult to really follow what to use and how to use it.

Thanks

Hi there!

You can safely disable the legacy com.unity.modules.unityanalytics package.
For tutorials that should work with 6.0.2 about recording events and creating a custom event - check out the docs.unity.com page.

The code in you snippet looks like similar examples I’ve seen before, but if you share your error messages and which bit of the code is giving you those error messages, I may be able to assist :slight_smile:

Cheers
C’tri