> For the complete documentation index, see [llms.txt](https://docs.candy-smith.com/main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.candy-smith.com/main/general-info/analytics/gameanalytics.md).

# gameanalytics

Use GameAnalytics when the buyer's project uses the GameAnalytics platform.

## GameAnalytics setup

{% stepper %}
{% step %}

## Install the GameAnalytics Unity SDK

Install the official GameAnalytics Unity SDK through its supported UPM or custom package workflow.

Alternatively, import the official GameAnalytics Unity package.
{% endstep %}

{% step %}

## Open the GameAnalytics window

Open:

```
Window > GameAnalytics
```

{% endstep %}

{% step %}

## Configure the keys

Configure the buyer's `game key` and `secret key`.
{% endstep %}

{% step %}

## Create the GameAnalytics object

Create exactly one GameAnalytics object in the first scene.

The GameAnalytics object must be present when the game starts.

Only one GameAnalytics object should exist in the entire game.
{% endstep %}

{% step %}

## Save the scene

Save the scene.
{% endstep %}

{% step %}

## Add the SDK define if needed

If the installed package does not define it automatically, add:

```
GAMEANALYTICS_SDK
```

{% endstep %}

{% step %}

## Select GameAnalytics

Select `GameAnalytics` in `GameSettings`.
{% endstep %}
{% endstepper %}

## GameAnalytics IDs and keys

The following values belong in the GameAnalytics settings:

* `game key`
* `secret key`

{% hint style="warning" %}
Do not add these keys to:

* `GameSettings`
* HomeDesignMatch3Kit source files
* the analytics provider code
  {% endhint %}

## GameAnalytics event mapping

The provider maps events as follows:

* Level start, completion, and failure are sent as GameAnalytics progression events.
* Ad impression, completion, reward, failure, and click are sent through the native GameAnalytics ad API.
* Gameplay, popup, and IAP events are sent as GameAnalytics design events.
* Common analytics parameters are sent as custom fields.

{% hint style="info" %}
The Unity Analytics Schema Setup Wizard is not required for GameAnalytics.
{% endhint %}

## Official documentation

* [GameAnalytics Unity SDK](https://docs.gameanalytics.com/event-tracking-and-integrations/sdks-and-collection-api/game-engine-sdks/unity/)
