Skip to content

Latest commit

 

History

History
99 lines (68 loc) · 3.99 KB

README.md

File metadata and controls

99 lines (68 loc) · 3.99 KB

The Customer Data Platform for Developers

Website · Documentation · Community Slack


RudderStack Unity SDK

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.

Prerequisites

Get started with the Unity SDK

  1. Download rudder-sdk-unity.unitypackage.

  2. Import the downloaded package to your project. From the Assets menu, go to Import Package > Custom Package....

  3. Select rudder-sdk-unity.unitypackage from the downloaded location and click Open.

  4. Click Import in the import popup.

  5. Add RudderStack.prefab file from the path Assets/RudderStack/Unity/Prefabs/RudderStack.prefab to every scene in your Unity app. Also, make sure that RudderStack.prefab is linked to RSMaster, RSScreenView, and RSLogger scripts.

  6. Import the SDK

using RudderStack.Unity;
  1. Initialize the SDK as shown. Replace WRITE_KEY and DATA_PLANE_URL with 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")));

Sending events

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 }
                });

Contribute

We would love to see you contribute to this project. Get more information on how to contribute here.

About RudderStack

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.

Contact us

For more support on using the RudderStack Unity SDK, contact us or start a conversation in our Community Slack.