Search Unity

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:
    319
    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

    Joined:
    May 2, 2017
    Posts:
    14,446
    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:
    319
    wwcolter likes this.
  4. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
    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:
    28
    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

    Joined:
    May 2, 2017
    Posts:
    14,446
    wwcolter likes this.
  7. Baroni

    Baroni

    Joined:
    Aug 20, 2010
    Posts:
    3,262
    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.
     
    Rodzio, korimako, CanisLupus and 2 others like this.
  8. Markusn

    Markusn

    Joined:
    Jul 15, 2012
    Posts:
    22
    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:
    6
    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

    Joined:
    May 2, 2017
    Posts:
    14,446
    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:
    513
    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

    Joined:
    May 2, 2017
    Posts:
    14,446
    @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

    Joined:
    May 2, 2017
    Posts:
    14,446
    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:
    513
    Hi Jeff, did you call it in an Editor script or Runtime mode (Awake)?
     
  17. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    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:
    14
    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:
    14
    If I modify UnityConnectSettings.asset 'm_InitializeOnStartup =0'directly, let will it have any impact
     
  21. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    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:
    80
    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:
    43
    Anyone tested to disable Unity Analytics to be disabled at startup(?):
    UnityAnalyticsSettings:
    m_Enabled: 0
    m_TestMode: 0
    m_InitializeOnStartup: 0
     
  25. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    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?
     
  26. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    Hello,
    Our app just got rejected and this is the answer we got from apple.

    Guideline 1.3 - Safety - Kids Category


    We noticed that your kids app includes third-party analytics, third-party advertising or collects, transmits, or has the ability to share personal information or device information.

    Specifically, your app includes the following feature(s), contrary to guideline 1.3 of the App Store Review Guidelines:

    Third-party analytics with the ability to collect, transmit or share identifiable information (such as name, address, date of birth, email, location, photos, videos, drawing or the ability to chat), device information, or the IDFA.

    Next Steps

    To resolve this issue, please remove this functionality or revise your app so that no personally identifiable information or device information is sent to third parties.


    So my question is is there anyway we can use unity analytics and remove any IDFA information so that we still can use our custom events. We use custom events to get information about what kind of activity the user is doing in the app. Otherwise the only option we have is to disable unity Analytics. We are using IAP in the app.
     
  27. hsallander

    hsallander

    Joined:
    Dec 19, 2013
    Posts:
    46
  28. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    Hi thanks for the answer. We do not use ads in the app it is disabled. when reading the documentation it says (IDFA is only collected if Unity Ads is also enabled) . We do not have unity ads enabled. So is there somewhere else i need to set coppa compliance? I do remember checking the box for coppa compliance but now i dont seem to find it.
     
  29. hsallander

    hsallander

    Joined:
    Dec 19, 2013
    Posts:
    46
    In the Services tab there's a view called Age Designation, check the box there to make Unity Services treat it as an app that needs to be Coppa compliant.
     
  30. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    Ok so I have checked if we really have the coppa box checked and we do. Also we do not have any ads enabled. So Im a little lost on how we should proceed.
     
  31. hsallander

    hsallander

    Joined:
    Dec 19, 2013
    Posts:
    46
    I opened one of our xcode projects/builds and checked now and for us it doesn't add the AdSupport framework, we're using:
    * From Unity Services (app designed for kids under 13, checked) : Unity Analytics, Unity IAP (version 1.19.0, obs an older version), Unity Cloud Build
    * Firebase Analytics and Crashlytics

    Are you perhaps using any other other third-party plugins for tracking that might be adding the AdSupport framework? You could maybe check the Editor Log just after creating a build from Unity and see there what might be adding the framework.

    And as a quick fix, just to get the release out, you could try just manually removing the AdSupport framework from the build in Xcode before compiling. And from there either it crashes and you can see what part of the code is calling it, to be able to pinpoint what's using it, or it runs just fine without it.
     
  32. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    Thank you! I will check if this is the issue.
     
  33. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    I have checked the xcode project and no adsupport framework added. Also we dont have any other tracking service in the project. It is annoying because according to Unity documentation it should not be sending any IDFA if no ads added and coppa checkbox clicked.

    @hsallander are you guys using unity analytics in kids app and also iAP ? The app we are making is a subscription service that provides kids content. Also which unity version are you using? Im on 2019.2.
     
  34. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We have been discussing here and continuing to check with our sources. But it seems so far that you will likely need to disable Analytics in your game at run time for Kids games. As mentioned, the issue is likely not related to an IDFA
     
  35. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    Thanks for the all the feedback guys. Guess i will have to disable it for now and send in a new version ans see if they will accept it.
     
  36. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    Ok for your information i did send Apple a question about this issue and this is their answer.

    If you are using third-party libraries, please update to the most recent version of those libraries. If you do not have access to the libraries' source, you may be able to search the compiled binary using the "strings" or "otool" command line tools. The "strings" tool can output a list of the methods that the library calls and "otool -ov" will output the Objective-C class structures and their defined methods. These tools can help you narrow down where the problematic code resides. You could also use the "nm" tool to verify if any third-party libraries are calling these advertising APIs.

    So it seems like something is calling advertising apis. Even though we have no AdSupport framework and i have coppa compliance checked in the editor. I did what they asked but still no luck. Did find this forum post where i did see another user saying that apple has changed their policy about kids apps. https://forum.unity.com/threads/ios-advertising-identifier-rejection-faq.226187/page-4
     
  37. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Might not be ads, you would probably want to check and confirm with Charles Proxy https://support.unity3d.com/hc/en-us/articles/115002917683-Using-Charles-Proxy-with-Unity
     
  38. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    319
    It is always good to use Charles Proxy (I use iOS app) to verify what data is being sent out from your app.

    As well as tick the under 13 box in services, I also set Analytics.limitUserTracking = true as it is on be default

    "Setting this property to true causes the Analytics service to further anonymize data by not sending SystemInfo.deviceUniqueIdentifier for game users. By default limitUserTracking is false."

    https://docs.unity3d.com/ScriptReference/Analytics.Analytics-limitUserTracking.html

    I've not had a rejection for this yet, if I do I'll just remove all Unity Analytics from my app (which is a shame because the performance/crash data is useful)
     
  39. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  40. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    Yes we have implemented a parental gate. We also got rejected again. We have a rewneable subscription. The steps i have taken are these.

    1. Removed a installed ads package in the unity editor from the package manager (noticed it was installed but i have not installed it) which we do not use.
    3. Checked so that Adsupport framework was not in xcode project.
    4. Disabled HW statistics
    5. Checked with Charles proxy to see if i was sending anything other. I noticed that the device id was sent so i disabled that so it now says "unknown".
    6. Added code

    [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
    public static void OnRuntimeMethodLoad()
    {
    UnityEngine.Analytics.Analytics.enabled = true;
    UnityEngine.Analytics.Analytics.deviceStatsEnabled = false;
    UnityEngine.Analytics.Analytics.limitUserTracking = true;
    }

    And yes i was hoping even that the unity analytics is enabled that the other options still would be enough. Because we use custom events that just track what activity they are using.


    Still got rejected this is what they say. Have been rejected twice for the same thing now. I have asked them about what exactly they are finding that they are rejecting me on. but im waiting for answer.

    --------------------------
    We noticed that your kids app still includes third-party analytics, third-party advertising or collects, transmits, or has the ability to share personal information or device information.

    Specifically, your app includes the following feature(s), contrary to guideline 1.3 of the App Store Review Guidelines:

    Third-party analytics with the ability to collect, transmit or share identifiable information (such as name, address, date of birth, email, location, photos, videos, drawing or the ability to chat), device information, or the IDFA.

    Next Steps

    To resolve this issue, please remove this functionality or revise your app so that no personally identifiable information or device information is sent to third parties.

    -------------------------

    So now my only hope is to disable it completely. Is this what i have to do now? I cant use analytics at all?
     
  41. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    This is what it says in apple's guidelines for kids category

    Apps in the Kids Category should not include third-party analytics or third-party advertising. This provides a safer experience for kids. In limited cases, third-party analytics may be permitted provided that the services do not collect or transmit the IDFA or any identifiable information about children (such as name, date of birth, email address), their location, or their devices. This includes any device, network, or other information that could be used directly or combined with other information to identify users and their devices.

     
  42. DiveoMedia

    DiveoMedia

    Joined:
    Jan 30, 2020
    Posts:
    1
    Yes, no third party analytics at all. We created our own analytics. lol
    I know it is a pain now to advertise on facebook or other platforms because you can't track anything at all. The only solution here is Search Ads and own campaign links in App Store Connect.
     
  43. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    So @DiveoMedia Did you use the code example above to disable unity analytics? And that worked it got you through apple review?
     
  44. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    @JeffDUnity3D Could you confirm if I can disable UnityAnalytics and still use iap ? Because I have added the code

    [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
    public static void OnRuntimeMethodLoad()
    {
    UnityEngine.Analytics.Analytics.enabled = false;
    UnityEngine.Analytics.Analytics.deviceStatsEnabled = false;
    UnityEngine.Analytics.Analytics.limitUserTracking = true;

    Debug.Log("Disabled UNITY ANALYTICS");
    }

    But still when checking with charles proxy i still see calls to config.uca.cloud.unity3d.com, cpd.cloud.unity3d.com also ecommerce.iap.unity3d.com

    Also the Request body is including all of these posts. The deviceId post is showing unknown.

    appid
    userid
    sessionid
    platform
    platformid
    sdk_ver
    session_count
    localprojectid
    build_guid
    deviceid
    t_since_start

    The Response body is saying

    {"analytics":{"enabled":true},"connect":{"limit_user_tracking":false,"player_opted_out":false,"enabled":true},"performance":{"enabled":true}}

    So i really need to know how i can have iap enabled and analytics disabled. Because the Apple Guidelines clearly states that the app cannot contain any thirdparty analytics.. This is a true roadblock for us... The app should have been uploaded and done in december 2019 and it is almost february 2020.

    This is from apples guidelines
    Guidelines 1.3 and 5.1.4. In order to help keep kids’ data private, apps in the kids category and apps intended for kids cannot include third-party advertising or analytics software and may not transmit data to third parties. This guideline is now enforced for new apps. Existing apps must follow this guideline by September 3, 2019.
     
  45. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We are still checking with our sources at Apple
     
  46. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    @JeffDUnity3D Thank you! Please let me know when you hear something.
     
    JeffDUnity3D likes this.
  47. Jakob

    Jakob

    Joined:
    Sep 29, 2011
    Posts:
    42
    @JeffDUnity3D Do you think this will be solved in the near future? Have you heard anything from apple? We have still not been able to upload and release the app and the time goes by. It is just frustrating because the app has been done for awhile.
     
  48. Funtyx

    Funtyx

    Joined:
    May 3, 2017
    Posts:
    37
    Tell me please, has anyone solved the problem of publishing a child’s game on the App Store? We have already 3 times rejected the game.

    Here is our correspondence with Apple:

    Guideline 2.1 - Information Needed


    Before we can proceed with the review of your app, we need additional information about how it complies with Guideline 1.3.

    Next Steps

    To help us proceed with the review of your app, please provide complete and detailed responses to the following questions.

    • Does your app include third-party analytics? If so, please provide details about what data is collected for this purpose.
    • Does your app include third-party advertising? If so, please provide a link to the ad network's publicly-documented practices and policies for kids apps.
    • Will the data be shared with any third parties? If so, for what purposes and where will this information be stored?
    • Is your app collecting any user or device data for purposes beyond third-party analytics or third-party advertising? If so, please provide a complete and clear explanation of all planned uses of this data.

    Once you reply to this message in Resolution Center with the requested information, we can proceed with your app's review.



    Since your App Store Connect status is Metadata Rejected, we do NOT require a new binary. To revise the metadata, visit App Store Connect to select your app and revise the desired metadata values. Once you’ve completed all changes, reply to this message in Resolution Center and we will continue the review.

    -------------

    Guideline 1.3 - Safety - Kids Category


    We noticed that your kids app includes third-party analytics, third-party advertising or collects, transmits, or has the ability to share personal information or device information.

    Specifically, your app includes the following feature(s), contrary to guideline 1.3 of the App Store Review Guidelines:

    Third-party analytics with the ability to collect, transmit or share identifiable information (such as name, address, date of birth, email, location, photos, videos, drawing or the ability to chat), device information, or the IDFA.

    Next Steps

    To resolve this issue, please remove this functionality or revise your app so that no personally identifiable information or device information is sent to third parties.

    -------------

    Guideline 1.3 - Safety - Kids Category


    We have continued to find that your app contains third-party analytics with the ability to collect, transmit or share identifiable information (such as name, address, date of birth, email, location, photos, videos, drawing or the ability to chat), device information, or the IDFA.

    Next Steps

    To resolve this issue, please remove this functionality or revise your app so that no personally identifiable information or device information is sent to third parties.

    -------------

    Hello,

    Thank you for providing this information.

    Regarding 1.3.0, your app still appears to use third-party advertising with the ability to collect, transmit or share identifiable information, device information, or the IDFA.

    If you are using third-party libraries, please update to the most recent version of those libraries. If you do not have access to the libraries’ source, you may be able to search the compiled binary using the “strings” or “otool” command line tools. The “strings” tool can output a list of the methods that the library calls and “otool -ov” will output the Objective-C class structures and their defined methods. These tools can help you narrow down where the problematic code resides. You could also use the “nm” tool to verify if any third-party libraries are calling these advertising APIs.

    We look forward to reviewing your resubmitted app.

    Best regards,
    App Store Review
     
  49. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  50. korimako

    korimako

    Joined:
    Aug 10, 2013
    Posts:
    40
    What is the status of this? I don't want to collect any data through analytics, and Apple doesn't either. I do want to add a subscription IAP. Does Unity have a solution documented? Or do we have to use the disable at runtime? Does that work-around work? I have read the threads but I am unclear what the best practice is here. Thanks!