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

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:

  • Install the Unity Analytics SDK from the Package Manager
  • Opt-In to Analytics in the Unity Dashboard: Unity Cloud
  • Follow the consent flow after initializing the UGS SDKs, which is an extra step specific to Analytics – see Unity SDK tutorials and Data privacy and consent
  • Initialize the UGS Runtime Service in your App

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.

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)?

Just call this bit of code from this documentation:

AnalyticsService.Instance.OptOut();

UGS settings will not effect Unity IAP.

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.

1 Like

That is just a warning. IAP should continue to work.

My thread was deleted and labeled misinformation from posting a copy+paste from this thread which is verified Unity accounts. https://discussions.unity.com/t/632966 page-2

I am confused now. Is the information changed from the official sources? Will UGS be required in the future or not? :frowning:

Please post the link instead of copy-paste https://discussions.unity.com/t/632966 page-2#post-8289488

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://discussions.unity.com/t/632966 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.

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://discussions.unity.com/t/892130

1 Like

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.

Correct.

1 Like

Calling this results in a ConsentCheckException: The required consent flow cannot be determined. Make sure GeoIP was successfully called.

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.

5 Likes

Agreed, we still need to update the documentation. Sorry about that, things have changed fast in this area.

3 Likes

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.

1 Like

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.

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?

3 Likes

OK… I’m a bit confused here.
I am trying to implement IAP using Unity IAP for a 2022.3 URP 2D Android/IOS game.
I do not want unity analytics as I am using a different analytics service.
I have installed the Unity IAP service from the package manager.
I have not installed Unity Analytics
(on a side note: the screenshots shown in Unity IAP 4.11.0 documentation dont seem to match what I see in the package manager/services under 2022.3)

The Unity IAP 4.11.0 documentation still seems to indicate that I need to initialize UGS at runtime. Do I need to do this?

Never mind. I believe the answer to my question is “No, I dont need to initialize UGS to use IAP - for now”. The “for now” is a bit odd… but anyway… Answer from this faq: FAQ for IAP 4.2+ and adoption of UGS Services

Hi. But UnityEngine.Purchasing.UnityServicesInitializationChecker says “Unity In-App Purchasing requires Unity Gaming Services to have been initialized before use.”. All indications and documentation say that UGS is required, yet you say it isn’t. Who is correct?