Upgrade Unity Analytics 5.1 to 5.2

Upgrade Unity Analytics 5.1 to 5.2
Re-integration of Unity Analytics
Follow the 5.2 integration instructions in Integration Pages which consists of these steps:

  1. Confirm your Project IDs match
  2. Enable Analytics
  3. Play to Validate

You can determine that you successfully completed the upgrade by checking the SDK version in Play to Validate step and confirming that it is version u5.2 displayed in Validator.

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 5.2 syntax. Follow 5.2 Advanced Integration instructions to update.

2 Likes

The links on this page seem to be broken - they just take me to analytics.unity3d.com

Hi @ThePuzzler - Apologies on the confusion. If you log into analytics.unity3d.com the instructions are displayed in Integration Pages. Select 5.2 from the dropdown menu and follow the instructions.

Let us know if you need more information or assistance. Thanks.

Hello, how can one set the code for analytics/project from code? I used before 2 codes for my apps, one for testing and one for release. It would be nice to have to option to override the analytics code from our scripts and to be able to reset all the data from the site.

Hi @Victor_Kallai

Currently there is no was to accomplish this programatically. It looks like you are using Unity 5.1 with the engine integrated Analytics and the only way to change the cloud project id is to manually go into the Player Settings and switch out the ids.

I’m using Unity 5.2, but the problem is the same. Should I post a suggestion to the feedback section to change this? I do not think that is too much to ask, just a method: Analytics.SetId(xxxx-1234);

@Victor_Kallai ,

That is a great idea, I believe the topic already exists so you should be able to just vote for it, http://feedback.unity3d.com/forums/unity/suggestions?utf8=✓&status=0&category=analytics&view=hottest

hi, on myside the unity engine 5.2 is displayed for editor version (mac) , but for android version ( export as apk), the SDK version still u5.1.1f1 in analityc dashboard, so what’s going on?

i already delete the previous game installation on phone. and ensure correct apk delivered, but still track wrong sdk version. need your help.

Hi @rizalas ,

Would you mind open a support ticket here, Unity Cloud It will give me some more information about your game and also help me track my progress on this issue for you.

How can i work without internet connection? sometime unity editor makes services off and it cause compile error.i also get runtime error; FileNotFoundException: Could not load file or assembly ‘UnityEngine.Analytics, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies.

1 Like

As Atmuc I have the same issue. It appears after upgrade to 5.2 Unity doesn’t seem to see Analytics namespace! How to fix it?

Error:
The name `Analytics’ does not exist in the current context

1 Like

Hi @atmuc and @IndieForger ,

This is a problem that we are aware of and are currently working on. As a temporary workaround you can use #if UNITY_ANALYTICS to surround your Analytics functions. What this will do is cause the contained code to execute only if Analytics is enabled, or in your cases if Analytics is enabled and you have an active internet connection.

#if UNITY_ANALYTICS
Analytics.SendCustomEvent(“LevelStarted”, null);
#endif

Thank you @mpinol

I my case problem was actually somewhere else. Unity update to 5.2.x has auto-disabled Analytics. Had to reactivate it from Window > Unity Services. Once done everything went back to normal.

1 Like