Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  4. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Initialize Analytics project id from code?

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

  1. Astro75

    Astro75

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

    mpinol

    Unity Technologies

    Joined:
    Jul 29, 2015
    Posts:
    315
    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:
    42
    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

    Unity Technologies

    Joined:
    Jul 29, 2015
    Posts:
    315
    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:
    35
    @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

    Unity Technologies

    Joined:
    Jan 20, 2016
    Posts:
    311
    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