Solved

Cross-Platform Unity Integration (beyond iOS and Android)

  • 21 September 2021
  • 7 replies
  • 246 views

Userlevel 1
Badge +2

Hello!

I was very disappointed to learn that the Amplitude Unity plugin only supports iOS and Android platforms. Unity game engine supports a variety of other platforms also:

For what purpose has the Unity integration been limited to iOS and Android?

Is it possible to integrate Amplitude for the other platforms, such as PC, Mac, Linux, Xbox, PlayStation, and WebGL?

Within Unity, could the HTTP API V2 be used instead of the Amplitude Unity plugin if platforms beyond iOS and Android are targeted (such as Unity + Windows/PC)?

icon

Best answer by MikkoKarvonen 22 September 2021, 06:51

View original

7 replies

Userlevel 5
Badge +2

Amplitude has been originally designed for tracking mobile application and website usage, which is reflected in the SDK platform choices.

However, there is no need to limit yourself to tracking these platforms. We are in a similar situation that we want to track platforms there is no SDK for. We are doing this via HTTP API with great success. It’s some extra work, as you need to get the data into correct JSON format and implement your own logic for sending the events, but I assume a platform like Unity should allow you to do that with reasonable ease.

Some tips based on our experiences with the HTTP API and multi-platform tracking:

  • Set up a separate Amplitude project for development phase. This allows you to send in test events and figure out the right format without polluting your production data.
  • Make sure you get the UserID set up correctly on all platforms. This helps you to identify the same user on different platforms.
  • Make sure you implement the data in exactly the same way on all platforms. Even just different capitalization (“Level” vs “level”) will give you two separate event property values instead of one. You can overcome this during the analysis, but it can be somewhat annoying.
  • Make sure you implement your Platform user property correctly when using HTTP API, as that does not track it automatically. This allows you to identify which platforms the users are using. You might also want to consider a property “OriginalPlatform” or something similar, set up when the user first starts using your product.
  • Think about whether you want to track the same platforms on the same or different Amplitude projects. Most likely you’ll want the data in one place, but if there are significant differences between the platforms, there might be a case for a separate project.
Userlevel 1
Badge +2

@MikkoKarvonenThis is very helpful! Thank you so much!

 

I understand the reasoning, given Amplitude’s original design for Mobile + Web. But there’s really no difference between analytics for games or applications. You have to define what you want to track either way.

 

That being said, I’m happy I can use the HTTP API, but I also think it would be smart for Amplitude to support more platforms in the Unity SDK. There is an opportunity to capture more customers that way!

Userlevel 4
Badge +4

Hello @REM5 Studios thank you for the feedback! My name is Eddie and I am part of the Support Team here at Amplitude. I will submit a feature request that you have recommended to our product team. 

Do you have a game for all the platforms mentioned or a subset of them? (i.e PC, Mac, Linux, Xbox, PlayStation, and WebGL) If so, which platforms?

Userlevel 1
Badge +2

Thank you very much @eddie.gaona ! I appreciate you passing this along and submitting a feature request.

While having Amplitude SDK support for all platforms that Unity supports would be ideal, the additional platforms that are most important to me (in order of importance) are: PC/Windows, WebGL, Mac, and PlayStation.

Specifically, I am a VR developer and my focus is on VR apps that are cross-platform, while also including a non-VR mode for certain platforms (so that it is accessible to the most amount of people). The targeted platforms will include: Android (Oculus Quest 1 & 2, Vive Focus 3, Pico), PC/Windows (Steam VR, Oculus, & non-VR mode), PlayStation (PSVR, & non-VR mode), WebGL (WebXR, WebVR, and non-VR mode), and Mac (non-VR mode).

I would love for Amplitude to be a turnkey solution for all of this! And I’m sure many others would also!

Userlevel 2
Badge

@REM5 Studios cool to see someone using Amplitude for VR solutions.  Curious if your instrumentation plan includes understanding headset/platform behavior in addition to in-app / game behavior (for example: session time between headset removals).  If so, how are you instrumenting the application to trigger such events?

Userlevel 1
Badge +2

@REM5 Studios cool to see someone using Amplitude for VR solutions.  Curious if your instrumentation plan includes understanding headset/platform behavior in addition to in-app / game behavior (for example: session time between headset removals).  If so, how are you instrumenting the application to trigger such events?

 

Yes of course! We’re able to track whenever someone removes or puts on the headset (Oculus/Meta SDK provides C# events for this which can be used to trigger an analytics event). Our most recent use of Amplitude was for Quantum Mirror VR, which is a high-throughput VR installation as part of the full Quantum Mirror experience (https://www.quantummirrormn.com/).

 

We’ve also used analytics to track which % of users focus their attention on certain areas of the experience (based on the direction their head is facing) and this has proven useful. For example, no one was looking up at a cool dynamic ceiling I made, so I added some extra flair to help draw their attention upward. :)

Userlevel 1
Badge +2

Looping back to this topic, I’ve successfully implemented the HTTP API v2 inside Unity, using the native UnityWebRequest functionality to send POST requests. This method should carry over to any platform that supports using HTTP requests!

Reply