Search Unity

Exclude or Filter Out Unity Editor

Discussion in 'Unity Analytics' started by SureSight, Jun 22, 2015.

  1. SureSight

    SureSight

    Joined:
    Aug 2, 2013
    Posts:
    65
    We seem to be getting some noise from the dev team when testing in the editor. Ideally only analytics from real users in the built project should be reported.

    Is there a way to turn off analytics when running in the Unity Editor or filtering the editor results out from the dashboard?
     
  2. elie-noune

    elie-noune

    Joined:
    Apr 27, 2015
    Posts:
    20
    Hey @SureSight,

    We don't support this today but isolating test data from the editor is something we plan to do in the future. The closest solution at the moment is to create 2 different projects, one for 'dev' and the other one for 'prod'. We were thinking of logging the data that comes from the editor under a 'test users' segment that we would exclude from all other segments by default, but still make it available. Would you want to be looking at data for 'test users' or would it be enough if we just excluded that from your users and didn't make it available? I'd love to understand what you're trying to accomplish.
     
  3. SureSight

    SureSight

    Joined:
    Aug 2, 2013
    Posts:
    65
    Hi @elie.noune

    I can see a segment for 'test users' might be useful in future, but our immediate concern is isolating data from real users in the wild so we can draw some meaningful information from our target audience.

    The game is currently in pre-alpha and we're hoping to get some useful balancing insights from analytics to help us nail down some game features.

    I worry that the editor sessions for the programmer and 3D artist will skew this real data to be less reliable since we typically only run the game in 1 test level to test small features in isolation.
     
  4. elie-noune

    elie-noune

    Joined:
    Apr 27, 2015
    Posts:
    20
    That makes sense @SureSight, thanks for the explanation. Unfortunately, there's no quick fix to this situation from our end at the moment. The only thing that can be done is creating a different project id for development purposes and having your team test on that one instead of the 'production' project.
     
  5. sebastiansgames

    sebastiansgames

    Joined:
    Mar 25, 2014
    Posts:
    114
    I'd like to second this request. I suppose it's easy enough to just turn analytics off when i'm actually developing and turn on again before building, but analytics gathered during the development process in editor are not very useful to me at all (as any dev can tell you, you become an expert at dying in your own game on purpose to test random things).

    The solution of having a 'test users' flag or an 'in editor' flag would definitely work for me.

    Better yet, how bout a quick checkbox/toggle in the editor nav for analytics on/off?

    Thank you!
     
  6. mpinol

    mpinol

    Joined:
    Jul 29, 2015
    Posts:
    317
    sebastiansgames likes this.
  7. Carwashh

    Carwashh

    Joined:
    Jul 28, 2012
    Posts:
    763
    As a short term solution, if you don't require any stats from the editor then could you not wrap the initialisation call in a platform dependant #if !UNITY_EDITOR ?

    Though I've not spent much time with the analytics since prior to 5.1 and can't recall if the initialisation still needs coding? (apologies if not)
     
    Last edited: Mar 10, 2023
  8. Pawl

    Pawl

    Joined:
    Jun 23, 2013
    Posts:
    113
    +1, at the very least I would say having an 'IsTrackingEnabled' bool to disable editor tracking is essential. Filtering them under a different category would be nice to have, but not required.

    However if it's not supported at the Unity level, it's easy to wrap all calls at the game level via some GameAnalyticsIntegration class and use your own #if UNITY_EDITOR define to disable tracking as desired.
     
  9. MatrixGuo

    MatrixGuo

    Joined:
    May 2, 2015
    Posts:
    1
    I have also some problems fron UnityEditor when building in platform PC,Mac&Linux Standlone. The code work fine when test in unity, but the function from the namespace UnityEditor doesn't after build the project.
    The below is the code file:
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4.  
    5. #if UNITY_EDITOR
    6. using UnityEditor;
    7. #endif
    8. #if UNITY_EDITOR
    9. public class changeTexture2D :ScriptableObject{
    10.      
    11.     // Use this for initialization
    12.     void Start () {
    13.    
    14.     }  
    15.     // Update is called once per frame
    16.     void Update () {
    17.        
    18.     }
    19.     public  void ChangeText()
    20.     {
    21.         string path = "Assets/D_FABRIC_02NOR_P0.png";
    22.         TextureImporter textureImporter = AssetImporter.GetAtPath(path) as TextureImporter;
    23.         textureImporter.textureType = TextureImporterType.Image;
    24.         textureImporter.filterMode = FilterMode.Trilinear;
    25.         AssetDatabase.ImportAsset(path);
    26.         AssetDatabase.SaveAssets();
    27.         AssetDatabase.Refresh();    
    28.     }
    29.  
    30.  
    31.     public void ChangeNorthText()
    32.     {
    33.  
    34.         string path = "Assets/D_FABRIC_02NOR_P0.png";
    35.         TextureImporter textureImporter = AssetImporter.GetAtPath(path) as TextureImporter;
    36.         textureImporter.textureType = TextureImporterType.Bump;
    37.         textureImporter.filterMode = FilterMode.Trilinear;
    38.         textureImporter.convertToNormalmap = true;
    39.         AssetDatabase.ImportAsset(path);
    40.         AssetDatabase.SaveAssets();
    41.         AssetDatabase.Refresh();
    42.     }
    43. }
    44. #endif
     
  10. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
  11. Deleted User

    Deleted User

    Guest

    Hi, is there a solution yet for separating prod data and test data without creating 2 projects? If not could you please go into details on how to go about using 2 projects to achieve this?

    Thanks
     
    metanautvr likes this.
  12. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
  13. mattsbm

    mattsbm

    Joined:
    Jun 26, 2017
    Posts:
    2
    Would be great to have the ability to remove certain IDs from reporting.
     
  14. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    @mattsbm Might you be able to elaborate as to which IDs you are referring to?
     
  15. mattsbm

    mattsbm

    Joined:
    Jun 26, 2017
    Posts:
    2
    Thanks for the reply Jeff -- these would be the IDs of devices that we were using internally to test on prod. Basically, a feature where we could "black list" IDs from our reports.
     
  16. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    How are you generating the IDs, and how are you sending the ID to our system?
     
  17. MoDD

    MoDD

    Joined:
    Mar 29, 2013
    Posts:
    3
    Hello,
    a define to totally remove a build from analytics would be really helpfull.
    We have a kind of early access but we want to exclude the team testing the game at home and "real" players.
     
  18. TobiWoVR

    TobiWoVR

    Joined:
    Mar 1, 2018
    Posts:
    3
    Hi, yes we definitely need to exclude/seperate dev testing from release versions as well. Having an IP-Adress Filter would be fine as well. But currently we don't have reliable data from unity analytics and need to do workarounds. This way its nearly unusable...
     
  19. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You can create a segment based on the Build Version. Keep in mind that it takes time for a segment to populate after it's created, it does not back fill with previous events. But this of course implies different builds.
     
  20. paolo-rebelpug

    paolo-rebelpug

    Joined:
    Sep 27, 2021
    Posts:
    22
    Hey there,

    sorry for necroposting!

    I understand how to filter out development analytics from production ones but I would like to exclude entirely the development environment from sending any events at all (they are not free after a while). Opting out is the only solution? Would come handy to have a directive or something so that you can test everything then disable it.

    Thanks,
    Paolo
     
  21. RandolfKlemola

    RandolfKlemola

    Unity Technologies

    Joined:
    May 1, 2020
    Posts:
    130
    Hi paolo-rebelpug,

    That's a good idea! So essentially something to disable analytics from an individual environment of a project within the Unity Dashboard, for example?

    Best,
    Randy
     
  22. paolo-rebelpug

    paolo-rebelpug

    Joined:
    Sep 27, 2021
    Posts:
    22
    Hi @RandolfKlemola,

    sorry for my late reply.

    Yes it would be ideal if you can add two options in the Unity Editor Analytics dashboard, one to enable/disable tracking in the editor and one in a development build. It wouldn't make sense to send out events most of the time beside some specific testing session.

    For now we implemented a custom variable so that we filter them out manually but I must say is not the most efficient approach.

    Thanks and have a nice day,
    Paolo