Legacy Documentation: Version 5.1
User Attributes (recommended) (SDK)
VR Overview

Unity Analytics Upgrade Instructions

Unity Analytics comes built-in, starting with version 5.1 of the Unity Editor. What this means is that integration with Unity Analytics is even simpler than before. However, if you are upgrading an existing 4.x or 5.0 Unity project with Analytics already integrated to 5.1, there are a few simple steps you should follow.

The process is divided into three general steps:

  1. Removal of existing Unity Analytics SDK components
  2. Re-integration of Unity Analytics
  3. Updating of Advanced Integration events

Removal of existing Unity Analytics SDK

Version 5.1 of the Unity Editor comes with Unity Analytics built-in. You should remove existing Unity Analytics SDK components to ensure no conflicts and to help you maintain a cleaner project.

Locate the existing Unity Analytics SDK components in your Project folder. Most likely they will have been saved to Assets > Plugins.

Delete all components.

You can confirm that you successfully removed the Unity Analytics SDK if you close and re-open your project, and then don’t see the following message prompt.

Re-integration of Unity Analytics

To re-integrate Unity Analytics with your 5.1 project, go to your dashboard (analytics.unity3d.com), find your project, and navigate to the “INTEGRATION” section.

Select “5.1 Project Integration” in the drop-down menu, then follow the Basic Integration steps that you see there.

Finally, validate your Basic Integration using the Validator in Step 3. You can determine that you successfully completed the upgrade by checking the SDK version and confirming that it is u5.1.

Updating Advanced Integration events

If you did any existing Advanced Integration previously, you will also need to update the namespace and the calls to use the updated 5.1 syntax.

Reference the Unity Analytics SDK package

  • 4.x/5.0: using UnityEngine.Cloud.Analytics;
  • 5.1: using UnityEngine.Analytics;

Monetization Calls

  • 4.x/5.0: UnityAnalytics.Transaction(string productId, decimal price, string currency, string receipt, string signature);
  • 5.1: Analytics.Transaction(string productId, decimal price, string currency, string receipt, string signature);

Custom Event Calls

  • 4.x/5.0: UnityAnalytics.CustomEvent(string customEventName, IDictionary<string, object> eventData);
  • 5.1: Analytics.CustomEvent(string customEventName, IDictionary<string, object> eventData);

User Info Calls

  • 4.x/5.0:
    • UnityAnalytics.SetUserGender(Gender gender);
    • UnityAnalytics.SetUserBirthYear(int birthYear);
  • 5.1:
    • Analytics.SetUserGender(Gender gender);
    • Analytics.SetUserBirthYear(int birthYear);
User Attributes (recommended) (SDK)
VR Overview