Legacy Documentation: Version 5.1
Create Script to Start a Player Session (SDK)
Test & Validate (SDK)

Attach Script to GameObject (SDK)

The script you created contains the API call that initializes the Unity Analytics SDK and begins the data collection process. You can attach this script to any GameObject in any Scene in your game to initialize the Unity Analytics SDK.

In order to capture as much user engagement data as possible, we recommend that you attach the script to a GameObject in the first Scene of your game.

For an example of how to attach a script to a GameObject, follow the instructions below, which will walk you through attaching the script to a GameObject called the MainCamera.

Example: Attaching the Script to the MainCamera

Locate and select the GameObject (in this case, MainCamera) in the Hierarchy view.

Navigate to the Inspector and use Add Component to locate and attach the UnityAnalyticsIntegration script. Use the search bar to easily locate the script.

Create Script to Start a Player Session (SDK)
Test & Validate (SDK)