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

Upgrade Unity Analytics 5.1 to 5.2

Discussion in 'Unity Analytics' started by sschan, Sep 3, 2015.

  1. sschan

    sschan

    Moderator

    Joined:
    Oct 8, 2014
    Posts:
    87
    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.
     
    Last edited: Sep 10, 2015
    mpinol and angeloferro like this.
  2. ThePuzzler

    ThePuzzler

    Joined:
    Jul 10, 2015
    Posts:
    1
    The links on this page seem to be broken - they just take me to analytics.unity3d.com
     
  3. sschan

    sschan

    Moderator

    Joined:
    Oct 8, 2014
    Posts:
    87
    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.
     
  4. Victor_Kallai

    Victor_Kallai

    Joined:
    Mar 5, 2014
    Posts:
    123

    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.
     
  5. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
    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.
     
  6. Victor_Kallai

    Victor_Kallai

    Joined:
    Mar 5, 2014
    Posts:
    123
    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);
     
  7. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
  8. rizalas

    rizalas

    Joined:
    Sep 18, 2015
    Posts:
    2
    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.
     
  9. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
  10. atmuc

    atmuc

    Joined:
    Feb 28, 2011
    Posts:
    1,151
    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.
     
    codeDoc likes this.
  11. IndieForger

    IndieForger

    Joined:
    Dec 31, 2012
    Posts:
    92
    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
     
    alienonmars likes this.
  12. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
    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
     
  13. IndieForger

    IndieForger

    Joined:
    Dec 31, 2012
    Posts:
    92
    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.
     
    mpinol likes this.