Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Official FAQ for IAP 4.2+ and adoption of UGS Services

Discussion in 'Unity IAP' started by John_Corbett, Aug 24, 2022.

  1. John_Corbett

    John_Corbett

    Unity Technologies

    Joined:
    May 17, 2019
    Posts:
    144
    Hello,

    Many developers have asked what obligations they have to adopt the UGS Analytics service when using the In-App Purchasing Service. We've created this infographic and FAQ to hopefully resolve some of your concerns.

    [Edit: Updates have been made to reflect changes in Unity IAP 4.7.0. See https://forum.unity.com/threads/imp...nalytics-changed-as-of-version-4-7-0.1301283/ for more information]

    Infographic
    IAP UGS and Analytics Infographic.png


    Common Questions
    Service Adoption
    Q: Is In-App Purchasing a UGS Service

    A: Yes. In-App Purchasing has been a Unity Gaming Service for quite some time. For more information on what Unity Gaming Services are, check the documentation here.


    (Changed as of 4.7.0)
    Q: Installing the IAP package (prior to to version 4.7.0) installs the UGS Analytics package. Do I need to enable the UGS Analytics service?


    A: No. Opting into the UGS Analytics Service is your decision and is independent of your choice to use Unity IAP.


    (New as of 4.7.0)
    Q: Installing the IAP package (version 4.7.0 and later) doesn't the UGS Analytics package. What if I want the UGS Analytics service?


    A: You will need to install the Unity Analytics package (com.unity.services.analytics) into your project from the Package manager. We recommend at least version 4.4.0 at this time. You will then wan to Initialize the UGS Analytics Service in order to leverage Transaction and Transaction Failed events.


    Q: Do I have to pay to use the Transaction and Transaction Failed UGS Analytics events?

    A: No. These 2 events have been made free, in order to keep parity with these events which were historically free with Legacy Analytics



    Q: Can I still use Legacy Analytics?

    A: It depends. Projects whose Legacy Analytics service were activated before June 22nd, 2022, will still be able to leverage Legacy Analytics. Please note that this service will be shut down on June 27th, 2023, and data will no longer be collected.



    Runtime Service Initialization
    Q: What is Unity Gaming Services Runtime Initialization?

    A: Initializing Unity Gaming Services at runtime will enable UGS packages to communicate with the backend, and ensure that any features are running on the appropriate environment. Please refer to the Services Core SDK manual's documentation explaining it.



    Q: Do I need to Initialize IAP Unity Gaming Services?

    A: Not at the moment, but if you don't, your app will be unable to collect Analytics from the IAP's activities. You will also see the following warning in your App's runtime logs, which you can ignore for now:

    Unity In-App Purchasing requires Unity Gaming Services to have been initialized before use. Find out how to initialize Unity Gaming Services by following the documentation https://docs.unity.com/ugs-overview/services-core-api.html#InitializationExample or download the 06 Initialize Gaming Services sample from Package Manager > In-App Purchasing > Samples.




    Q: How do I initialize Runtime IAP Services

    A: Follow these instructions in the manual to activate them. Make sure to specify the environment you intend to target in your options.



    Q: Is it possible to initialize IAP's UGS runtime without doing so for UGS Analytics

    A: No, not at this time, unfortunately. However, if you never adopted the UGS Analytics service on the dashboard, this won't impact you, not will any errors occur.



    Package Dependency on UGS Analytics

    (Changed as of 4.7.0)
    Q: Why does the IAP SDK (prior to version 4.7.0) depend on the UGS Analytics SDK?


    A: Historically, IAP has always send Transaction and Transaction Failed to the Legacy Analytics API. It now does the same, but also sends these to UGS Analytics. Adding the package as a dependency facilitates these calls without us having had to code some inefficient soft dependency checking or using Reflection. The decision was made simply for C# compilation expediency and performance efficiency.


    (New as of 4.7.0)
    Q: Why does the IAP SDK (version 4.7.0 and later) no longer depend on the UGS Analytics SDK?


    A: Some users wanted to opt-out of analytics collection. In order to make this seamless for users who wanted to opt-in, we coded a soft dependency on the Unity Analytics SDK, using it automatically if it is installed in the project as before.


    Q: What happens to calls to UGS Analytics if the Runtime Service isn't initialize or our project hasn't integrated UGS Analytics on our services dashboard?

    A: The Analytics calls may fail silently at some point, but the IAP SDK won't check for success or failure, nor will it wait. As far as the IAP SDK is concerned, it doesn't care if they fail.



    Q: What will happen to transactions in IAP in the case of Analytics events not being completed.

    A: Nothing bad will happen. The transactions will still be fulfilled and your app won't block waiting for a response. Same thing for failed or cancelled transactions. The calls to UGS Analytics are, as they were with Legacy Analytics, fire-and-forget.
     
    Last edited: Mar 15, 2023
  2. John_Corbett

    John_Corbett

    Unity Technologies

    Joined:
    May 17, 2019
    Posts:
    144
    Just a quick update to the top post: We're postponing the Legacy Analytics shutdown date to June 27th, 2023, and I've updated the date there.
     
  3. FabioTB

    FabioTB

    Joined:
    Nov 4, 2022
    Posts:
    1
    Hello there, any specific advice in order to use Unity IAP and be COPPA and GDPR, LGPD etc compliant?
    Just for context, the target is children under 13 and I'm not interested in UGS Analytics at the moment, just the IAP service.
    I found some documentation regarding COPPA here but it does not mention Unity IAP or Analytics.
     
  4. agorain

    agorain

    Unity Technologies

    Joined:
    Jun 28, 2022
    Posts:
    119
    Hi @FabioTB,
    We have a small mention of it in the doc here.

    You will need to answer a bunch of questions when setting IAP to be compliant.