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

Initialize Analytics project id from code?

Discussion in 'Unity Analytics' started by Astro75, Mar 16, 2016.

Thread Status:
Not open for further replies.
  1. Astro75

    Astro75

    Joined:
    Dec 18, 2014
    Posts:
    48
  2. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
    Hey @Astro75,

    What version of Unity are you using? If you are using 4.x - 5.1 with the downloadable Analytics plugin this is possible by calling UnityAnalytics.StartSDK (projectId); If you are using version 5.2 or above you do not need to add any code to initialize Analytics as it is integrated directly into the engine itself and will start as soon as your game loads.

    I hope this answers your question!
     
  3. Astro75

    Astro75

    Joined:
    Dec 18, 2014
    Posts:
    48
    We use Unity 5.3.4
    The problem is that we build build multiple apps from the same project using a custom build script. So I need a way to set up analytics id from code. Either in runtime or with an editor script.
     
  4. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
    Hey @Astro75,

    In Unity version 5.2 and above this is not possible, it is something we have heard would be an extremely useful capability to have from a lot of developers and we would like to implement this, but I cannot give you any real timeframe of when this might possibly become available.
     
  5. bzAdam

    bzAdam

    Joined:
    Aug 4, 2015
    Posts:
    39
    @mpinol Hi, is this feature available yet? We too have one project that builds numerous different apps (pro/lite versions). We would like to be able to set the Product ID vai code so that the analytics can track the different apps. Thanks.

    This is all done via cloud build from the same repo.
     
  6. erika_d

    erika_d

    Joined:
    Jan 20, 2016
    Posts:
    413
    Hi @bzAdam,

    Currently this ability is still not available. It is something we're looking into, but due to the project ID being universal for all services and the need for some sort of authentication of the project id being changed, it has turned out to be more complicated than expected. Because of this, I can't give any estimates on when this feature may be made available. If you would like to show your support for the feature you can vote on it here: https://feedback.unity3d.com/suggestions/change-cloud-project-id-at-runtime. We appreciate your patience!
     
  7. bogdan-hodorogea

    bogdan-hodorogea

    Joined:
    Nov 2, 2015
    Posts:
    8
Thread Status:
Not open for further replies.