Search Unity

Official Important: IAP SDK usage of Analytics changed as of version 4.7.0

Discussion in 'Unity IAP' started by John_Corbett, Jun 27, 2022.

  1. John_Corbett

    John_Corbett

    Joined:
    May 17, 2019
    Posts:
    151
    Updated on March 15th, 2023

    With the release of Unity IAP 4.7.0, the Unity Analytics SDK is no longer a hard dependency.
    The SDK will detect the presence of the Unity Analytics SDK indirectly and will still call
    Transaction
    /
    TransactionFailed
    events if the Unity Analytics SDK is present. However, if the Unity Analytics SDK is not included in your project, these events will not be sent.
    This change may raise questions from our users and we would like to address them in this post.
    This only applies to versions of IAP 4.7.0 and higher. OIder versions still have a hard dependency on the Analytics SDK.

    FAQ

    Q: The Unity Analytics SDK is no longer in my project. What happened? What do I do now?
    A: If your project didn’t have the Unity Analytics SDK in its manifest explicitly, it was only added by virtue of it being a dependency of IAP. If you don’t want to use it, you can leave your project as-is, however you will need it in order to collect transactional data from IAP. If you want to leverage Unity Analytics, or need it for other purposes and your project is experiencing errors, add it from the Package Manager

    Q: I see errors in my project related to
    Unity.Services.Analytics
    ? What should I do?

    A: Install the Unity Analytics SDK from the Package manager and your errors should go away. Make sure to choose a version compatible with what calls you are using. Note that if another package has a hard dependency on Unity Analytics, you may still need it.

    Q: The Unity Analytics package is still installed in my project and I intend to make use of it. What do I need to do?

    A: Nothing needs to change in your project. It should work exactly as you installed it before.

    Q: I have created a new project and want to use the IAP SDK and have it report transaction analytics. What do I have to do?

    A: Installing the In-App Purchasing SDK will no longer automatically install the Unity Analytics SDK. If you want it to report Transaction events to Unity Analytics, you will need to:

    Q: Am I responsible for paying for Unity Analytics?

    A: Unity Analytics is a paid service. If your usage of Unity Analytics exceeds the free tier limits, you will be responsible for paying for your usage. Note that while IAP transaction events are not billable, by installing Unity Analytics, your project will automatically send a number of billable standard events that will help you track usage, engagement, and retention.

    Q: Do I need to manually call the
    Transaction
    and
    TransactionFailed
    events?

    A: No, the IAP SDK will still call these automatically at the appropriate time, as before, so long as a compatible Analytics SDK is installed in your project.

    Q: Which version of the Analytics SDK is compatible with the IAP SDK?

    A: We recommend that you install at least com.unity.services.analytics 4.4.0 or higher, as of the release of IAP 4.7.0.

    Note:

    • It will work with 4.0.1, but there are known issues, so that’s not recommended.
    • The last version of Analytics that IAP depended on was 4.2.0
    • It may be a good idea to consult the Package Manager for the recommended version. It could be more up-to-date than 4.4.0.

    Q: Will the IAP SDK be compatible with future versions of the Analytics SDK

    A: We will keep maintaining the compatibility of the SDK over time. This could mean that you may need to update one or both of the packages at that point to maintain compatibility. There will be changes made that will ensure this compatibility in a more reliable fashion in the future.

    Q: The Analytics SDK is still in my project. Can I remove it?

    A: If you don’t want to track Analytics events in your project, including but not limited to those sent from the IAP SDK, you can remove it using the Package Manager. However, this means that the In-App Purchasing SDK will no longer record
    Transaction
    and
    TransactionFailed
    events.

    Q: I have an old project that has enabled the Legacy Analytics service. How does this affect my project?
    A: Until the cutoff date of June 27th, 2023, your app will still collect analytics from the legacy system. If you opt into the UGS Analytics service on the dashboard, you will have your Legacy Analytics mirrored there if you are using the production environment or don’t initialize UGS in the app. This remains exactly the same as it was in prior versions of the IAP SDK.



    Original Post From June 27, 2022:

    The In-App Purchasing SDK version 4.2.0 now leverages the new Unity Gaming Services Analytics service in order to track purchasing events in your app. This replaces the Legacy Unity Analytics, which is being closed for new projects as of June 22, 2022. To learn more about this change, please read our FAQ. To learn more about the new UGS Analytics, please refer to the documentation.


    If you are simply upgrading the IAP SDK from a previous version and you did not previously install the new Unity Analytics SDK 4.0.0, there are no additional programming steps that you need to take. The IAP SDK will automatically fire Transaction and Transaction Failed events, as was done in Legacy Unity Analytics. These can be observed on the new UGS Analytics dashboard.


    If you previously integrated Unity Analytics SDK version 4.0.0 into your project, please make sure that you are not manually calling the Transaction and TransactionFailed events if you are using IAP SDK 4.2 or later. It is important to remove these duplicate calls, as you may receive redundant event entries. and this could falsify the perceived user behavior collected using your app.


    The Legacy Unity Analytics events will still be tracked for a certain period hereafter. If you are still using the Legacy Unity Analytics dashboard, you will be able to observe the results previously collected for now. We encouraged you to start using the new UGS Analytics dashboard for revenue tracking. Data collected from the Legacy Unity Analytics, up to June 27th, 2023, will be mirrored in the new dashboard for more holistic tracking.


    Warning: do not disable the Legacy Unity Analytics service if you intend to use its data and dashboard for revenue and transaction tracking. After June 22nd, 2022, the opt-in period for Legacy Unity Analytics will be closed. After this date, any project that has disabled it will no longer be able to re-enable the Legacy Unity Analytics service.
     
    Last edited: Mar 15, 2023
  2. td-ys

    td-ys

    Joined:
    Jan 25, 2022
    Posts:
    7
    In my case, we have our own backend to handle analytics and don't use Unity Analytics for compliance on privacy laws. Can we turn off UGS Analytics?

    Furthermore, what else does the switch to UGS mean for Unity IAP aside from the initialization code? For example, will some UGS settings affect Unity IAP as well (Ex. environments, authentication)?
     
  3. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    811
    Just call this bit of code from this documentation:

    Code (CSharp):
    1. AnalyticsService.Instance.OptOut();
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    UGS settings will not effect Unity IAP.
     
  5. Sailendu

    Sailendu

    Joined:
    Jul 23, 2009
    Posts:
    254
    Does Unity IAP work without Unity Gaming Services? Can we disable UGS?

    As I am getting this warning in the console:
    "Unity IAP: Unity In-App Purchasing requires Unity Gaming Services to have been initialized before use."

    It seems like UGS is required for IAP.
     
    mfakkaya likes this.
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    That is just a warning. IAP should continue to work.
     
  7. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    811
  8. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  9. Sailendu

    Sailendu

    Joined:
    Jul 23, 2009
    Posts:
    254
    In the official Unity IAP post below, it is mentioned that:
    "In future releases of this package, initializing **Unity Gaming Services** will be mandatory"
    https://forum.unity.com/threads/uni...asset-store-v2-3-0.415517/page-2#post-8289488

    As far as I know, UGS is not completely free, so in future we are in a way supposed to pay to use Unity IAP? Please let me know.
     
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    UGS is free if you stay under 25M Analytics events per month. If you are going over that, then your game is very successful. The "mandatory" comments means if you want IAP Revenue Reporting on the Unity Dashboard, it would be required. Otherwise, it is not currently required and will not be in the future. This should help https://forum.unity.com/threads/faq-for-iap-4-2-and-adoption-of-ugs-analytics.1327011/
     
    Sailendu likes this.
  11. Sailendu

    Sailendu

    Joined:
    Jul 23, 2009
    Posts:
    254
    Thank you for the quick response and link to the other post. As I understand now, IAP will work fine without UGS, but IAP revenue reporting on unity dashboard will not function in that case.
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Correct.
     
    Sailendu likes this.
  13. MigrantP

    MigrantP

    Joined:
    Jun 24, 2013
    Posts:
    119
    Calling this results in a ConsentCheckException: The required consent flow cannot be determined. Make sure GeoIP was successfully called.
     
  14. j4n

    j4n

    Joined:
    Nov 30, 2017
    Posts:
    8
    Then please communicate this clearly in the relevant places and not make us dig for a random forum post, because neither the console warning nor the linked chart make it sound that way, and give us an option do disable the warning.

    I have zero interest in UGS or analytics of any sort (and the associated privacy/compliance baggage), I just want my app to talk directly to Google Play/App Store.
     
    Last edited: Sep 14, 2022
    JDubbY, Meltdown, khamada_ and 2 others like this.
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Agreed, we still need to update the documentation. Sorry about that, things have changed fast in this area.
     
    j4n, Sailendu and MousePods like this.
  16. John_Corbett

    John_Corbett

    Joined:
    May 17, 2019
    Posts:
    151
    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.
     
    tessellation likes this.
  17. John_Corbett

    John_Corbett

    Joined:
    May 17, 2019
    Posts:
    151
    Archive of Original Post Regarding Unity 4.2.0:

    The In-App purchasing SDK version 4.2 now leverages the new Unity Gaming Services Analytics service in order to track purchasing events in your app. This replaces the Legacy Unity Analytics, which is being closed for new projects as of June 22, 2022. To learn more about this change, please read our FAQ. To learn more about the new UGS Analytics, please refer to the documentation.


    If you are simply upgrading the IAP SDK from a previous version and you did not previously install the new Unity Analytics SDK 4.0.0, there are no additional programming steps that you need to take. The IAP SDK will automatically fire Transaction and Transaction Failed events, as was done in Legacy Unity Analytics. These can be observed on the new UGS Analytics dashboard.


    If you previously integrated Unity Analytics SDK version 4.0.0 into your project, please make sure that you are not manually calling the Transaction and TransactionFailed events if you are using IAP SDK 4.2 or later. It is important to remove these duplicate calls, as you may receive redundant event entries. and this could falsify the perceived user behavior collected using your app.


    The Legacy Unity Analytics events will still be tracked for a certain period hereafter. If you are still using the Legacy Unity Analytics dashboard, you will be able to observe the results previously collected for now. We encouraged you to start using the new UGS Analytics dashboard for revenue tracking. Data collected from the Legacy Unity Analytics, up to June 27th, 2023, will be mirrored in the new dashboard for more holistic tracking.


    Warning: do not disable the Legacy Unity Analytics service if you intend to use its data and dashboard for revenue and transaction tracking. After June 22nd, 2022, the opt-in period for Legacy Unity Analytics will be closed. After this date, any project that has disabled it will no longer be able to re-enable the Legacy Unity Analytics service.
     
  18. abogarsukov-braingames

    abogarsukov-braingames

    Joined:
    Jul 23, 2020
    Posts:
    40
    Hello,

    I don't want to use any Unity analytics (both legacy and UGS one), but I can see that the IAP package v4.8 still references Unity analytics (v1.0) as dependency. Does this mean I will be charged for using it?
     
    Last edited: Jun 9, 2023
    JDubbY, AnatolyK and epicstorydennis like this.