The Customer Data Platform for Developers
Website · Documentation · Community Slack
The RudderStack Unity SDK lets you track your game event data on all the major platforms like Android, iOS, Windows, macOS, Xbox, and PlayStation.
For detailed documentation on the Unity SDK, click here.
- Download and install the Unity development kit.
- Sign up for RudderStack Cloud.
- Set up a Unity source in your RudderStack Cloud dashboard. Note the write key for this source.
-
Download
rudder-sdk-unity.unitypackage. -
Import the downloaded package to your project. From the Assets menu, go to Import Package > Custom Package....
-
Select
rudder-sdk-unity.unitypackagefrom the downloaded location and click Open. -
Click Import in the import popup.
-
Add RudderStack.prefab file from the path
Assets/RudderStack/Unity/Prefabs/RudderStack.prefabto every scene in your Unity app. Also, make sure thatRudderStack.prefabis linked toRSMaster,RSScreenView, andRSLoggerscripts. -
Import the SDK
using RudderStack.Unity;- Initialize the SDK as shown. Replace
WRITE_KEYandDATA_PLANE_URLwith the actual values obtained in the SDK setup requirements section.
RSAnalytics.Initialize("WRITE_KEY",
new RSConfig(dataPlaneUrl: "DATA_PLANE_URL"));
// for coroutine
StartCoroutine(RSAnalytics.InitializeRoutine("WRITE_KEY",
new RSConfig(dataPlaneUrl: "DATA_PLANE_URL")));See the documentation for details on the supported events.
A sample track call is shown below:
RSAnalytics.Client.Track("sample_track",
new Dictionary<string, object> {
{ "key_1", "value_1" },
{ "key_2", 4 },
{ "key_3", 4.2 },
{ "key_4", true }
});We would love to see you contribute to this project. Get more information on how to contribute here.
RudderStack is a customer data platform for developers. Our tooling makes it easy to deploy pipelines that collect customer data from every app, website and SaaS platform, then activate it in your warehouse and business tools.
More information on RudderStack can be found here.
For more support on using the RudderStack Unity SDK, contact us or start a conversation in our Community Slack.