Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Unity IAP without Analytics for kids games?

Discussion in 'Unity IAP' started by coshea, Jun 3, 2019.

  1. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    253
    Apple just announced new rules for apps/games in the kids category...

    "Apps intended for kids may not include third-party advertising or analytics."

    "Collecting and transmitting data to third parties from apps in the Kids category is not allowed."

    https://developer.apple.com/app-store/review/guidelines/#kids-category

    How is anyone going to use Unity IAP now?

    Thanks
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    You can use IAP without Analytics, but you won't be able to track revenue in the Unity Dashboard. You need to disable Analytics at runtime.
     
  3. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    253
    wwcolter likes this.
  4. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    253
    The question is, if Apple are testing any outgoing server connections on apps in the kids category.

    If you have to disable analytics at runtime each time, is analytics going to connect to your servers in the phase before you can disable it?
     
    wwcolter, rushk1 and giuoliv like this.
  5. wwcolter

    wwcolter

    Joined:
    Nov 4, 2016
    Posts:
    23
    We were also under the impression that using Unity IAP required Unity Analytics to be enabled. Has this officially changed?
     
    Last edited: Jun 4, 2019
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    wwcolter likes this.
  7. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    2,273
    Wouldn't this be something that could be more "convenient" for the Unity user? I mean since Apple changed their policy regarding analytics in child apps, I would expect there is a better way in Unity than adding a few lines of code to disable analytics at runtime. Unfortunately the last thread linked here does still show Unity analytics is sending out requests.

    For example when setting up Unity IAP, we have a COPPA compliance option to select in the services window. When choosing "directed to children under the age of 13", this could already disable analytics for the app altogether?

    Disabling analytics at runtime for apps not directed to kids, and for developers that want to, is fine when done via code. But you can't expect all Unity developers creating kids apps adding code for this, or magically knowing they actually have to do this?

    I still vote for an option to turn off analytics completely, in the editor (without coding), kids app or not.
     
    Lars-Steenhoff likes this.
  8. Markusn

    Markusn

    Joined:
    Jul 15, 2012
    Posts:
    17
    The last thread linked clearly shows there are still connection attempts, the very thing Apple described as non compliant going forward. And what if they do static testing for known analytics code being present in the app? The way you describe disabling it, could I easily re-enable it later? Apple LOVES such approaches /sarcasm

    Also note that Apple is not just referring to "kids app" aka in the kids category. It's apps "intended for kids". That can be anything looking cute enough and knowing Apple they will probably not interpret this in a relaxed way. They even wrote a blog post two weeks ago about this https://developer.apple.com/news/?id=06032019j

    Please allow and support an iap without analytics option which does not bundle the analytics package with the app to begin with. As paying customers who use Unity for it's core premise, to publish clean Apps on Apple's platform, this hopefully is a fair request. And a fast turnaround would be much appreciated. This is one of the tightest deadlines Apple has introduced in recent time which only means they are darn serious about this. Neither you or us developers want to be in the News for another rejection wave :)

    Thanks for considering this!
     
  9. eeenmachine

    eeenmachine

    Joined:
    Aug 1, 2012
    Posts:
    1
    We just had to scramble for our new game sub, decided to rip out Unity Analytics/IAP and use Prime31 for cross platform IAP (the only one still maintained). I'm assuming Apple will resort to binary analysis to enforce this since if it is possible for devs to re-enable analytics after going through app approval they will.

    Working on an analytics solution we can host ourselves. Apple is right, the customer is trusting us (the publisher) with their data, not all these third party companies.
     
  10. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    Please use Charles Proxy to confirm. As mentioned, the network requests that you see are not the issue with Apple. They are only concerned about Analytics related events that might include user data. The non-Analytics network requests that you see after following the directions here, do not.
     
  11. MarvinE

    MarvinE

    Joined:
    Jan 16, 2017
    Posts:
    3
    After inspecting this myself, I can confirm that unity still sends two analytics related events at app start.

    I activated "Disable HW Statistics" in the player settings and disabled analytics at runtime with the following code as soon as possible:
    Disabling Analyitcs.png

    After inspecting the outgoing requests with Charles Proxy I can see the following two request endpoints:
    https://config.uca.cloud.unity3d.com
    https://cdp.cloud.unity3d.com

    Both contain appid, userid, sessionid, platform, plattformid, sdk_ver, localprojectid, build_guid and deviceid informations inside the headers.

    Next week I plan to upload and release a new app for kids to Apple and it would be really troublesome when Apple rejects the app because of this.
     

    Attached Files:

  12. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    482
    Just curious, did you try adding "UnityEngine.Analytics.Analytics.initializeOnStartup = false;"? Also you can try adding your script to the top of script execution order if you haven't yet...
     
  13. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    @MarvinE What version of Unity are you using? I will test also, and will provide my findings.
     
    Last edited: Jun 20, 2019
  14. MarvinE

    MarvinE

    Joined:
    Jan 16, 2017
    Posts:
    3
    Thank you very much for your fast replies.
    I still use Unity 5.6.5p4 for this project. But I also tested this on Unity 2018.2.9f1 with the same results.

    Adjusting the script execution order didn't change anything either and the Analytics.initializeOnStartup API doesn't seem to exist in this unity versions.

    Thanks again for the help.
     
  15. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    I just tested with Unity 2017 and 2018.3.4f1, and initializeOnStartup is in both versions. It does seem that it is required, along with the other methods, to suppress the calls to the endpoints mentioned. It likely does not exist in Unity 5.6, but I haven't checked specifically. Remember it's Analytics.Analytics.initializeOnStartup.
     
  16. PixelEnvision

    PixelEnvision

    Joined:
    Feb 7, 2012
    Posts:
    482
    Hi Jeff, did you call it in an Editor script or Runtime mode (Awake)?
     
  17. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    I added the above code in the screenshot as exactly shown (except for the try/catch block because I knew it would be there in my testing) to my IAPManager.cs that is associated to a game object in the first scene. And then I finally added the initializeOnStartup method, and I no longer saw any requests going to the config or cdp endpoints. I kept my phone updated with TestFlight during my testing. I originally put those lines also in the Start() and Awake() methods in IAPManager.cs. But I narrowed it down to just needing the runtime BeforeSceneLoad method being present. I also had Disable HW Stats checked. But I needed all the mentioned code too.
     
  18. Babybus_Study

    Babybus_Study

    Joined:
    Oct 31, 2016
    Posts:
    4
    I use 2017.4.6f1,and i cant find this ipa:Analytics.Analytics.initializeOnStartup
     
  19. MarvinE

    MarvinE

    Joined:
    Jan 16, 2017
    Posts:
    3
    Thank you very much for your investigations and help.
    I updated my project to the latest Unity 2017 version (2017.4.29f1) and indeed found the "UnityEngine.Analytics.Analytics.initializeOnStartup" API.
    So I could add "UnityEngine.Analytics.Analytics.initializeOnStartup = false;" above my other lines in the runtime BeforeSceneLoad method.

    Then I re-tested the outgoing requests with Charles Proxy and this time the two problematic analytics calls were really gone and everything works as expected.

    Thanks again for this great and fast support.
     
    Lars-Steenhoff likes this.
  20. Babybus_Study

    Babybus_Study

    Joined:
    Oct 31, 2016
    Posts:
    4
    If I modify UnityConnectSettings.asset 'm_InitializeOnStartup =0'directly, let will it have any impact
     
  21. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    That might do the trick also, I haven't tested yet. Are you able to test? I might suggest to try with the following:

    UnityAnalyticsSettings:
    m_Enabled: 0
    m_TestMode: 0
    m_InitializeOnStartup: 0
     
  22. GuyInception

    GuyInception

    Joined:
    Jun 12, 2019
    Posts:
    4
    Hi guys,

    Does anybody happens to know whether gathering Analytics in-house will be allowed by Apple?

    So you would still have a database of your own and you will be able to query for its data, but you won't send any of it to a third-party tool.
     
  23. Swah

    Swah

    Joined:
    May 13, 2015
    Posts:
    25
    My current understanding is that Apple does not want third party analytics, but is ok with self collected analytics from developers. At least I do know that some bigger companies are building their own analytic tools in part for that reason. That being said, I don't think anyone knows exactly how Apple will enforce this new policy.
     
  24. drorriov

    drorriov

    Joined:
    Jun 7, 2014
    Posts:
    34
    Anyone tested to disable Unity Analytics to be disabled at startup(?):
    UnityAnalyticsSettings:
    m_Enabled: 0
    m_TestMode: 0
    m_InitializeOnStartup: 0
     
  25. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    5,440
    Do you mean with only those settings in the UnityConnectSettings.asset file? What were the results of your Charles test? Does the code mentioned previously work for you?