Legacy Documentation: Version 5.2
Create Game Script
Play To Validate

Attach Game Script

The UnityAnalyticsIntegration script can be attached to any GameObject in any Scene in your game to initialize the Unity Analytics SDK. We recommend you attach the script to a GameObject in the first Scene of your game to ensure you begin capturing as much user engagement data as possible.

In this example, we will attach the script to MainCamera. First, locate and select “Main Camera” in the Hierarchy tab on the left hand side of the Editor.

Drag your script from the Projects tab and drop it on the Main Camera GameObject. In the Inspector window, with Main Camera selected, you should see that the script was assigned to the Main Camera as a Component.

Note: You can also add a script to a GameObject by selecting the GameObject in your Hierarchy and adding the desired script Component to it in the Inspector.

Create Game Script
Play To Validate