> 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/readme.md).

# README

The kit includes one common analytics pipeline with four selectable providers:

* Unity Analytics
* Firebase Analytics
* GameAnalytics
* ByteBrew

```
Gameplay, ads, and purchases
            ↓
AnalyticsEventTracker / AdsListener
            ↓
      IAnalyticsService
            ↓
   Selected analytics provider
```

The common runtime assembly is `CandySmith.Analytics`. Each provider implementation is isolated in its own assembly, so Firebase, GameAnalytics, and ByteBrew are optional dependencies.

## Common settings

Open:

```
Assets/HomeDesignMatch3Kit/Resources/Settings/GameSettings.asset
```

Use the `Analytics` section:

* `Analytics Provider` selects the provider used at runtime.
* `Enable Analytics` enables or disables analytics collection.

Unity Analytics is selected by default.

Only the selected provider is initialized. The other provider folders may remain in the project.

Optional provider assemblies use SDK-specific assembly definition constraints. Therefore, missing Firebase, GameAnalytics, or ByteBrew SDKs do not produce compilation errors.

{% hint style="warning" %}
If a provider is selected without its SDK and scripting define, the game reports an explicit initialization error instead of silently switching to another provider.
{% endhint %}

## Consent and data collection

`Enable Analytics` is the kit-level collection switch. For production, keep analytics disabled until the game's privacy and consent flow allows data collection.

The runtime service exposes:

```csharp
IAnalyticsService.SetDataCollectionEnabled(bool enabled);
```

{% hint style="info" %}
The kit-level setting does not replace platform-specific privacy requirements such as iOS App Tracking Transparency, Firebase consent configuration, or advertising network consent requirements.
{% endhint %}

## Provider documentation

* [Unity Analytics](/main/general-info/analytics/unity-analytics.md)
* [Firebase Analytics](/main/general-info/analytics/firebase.md)
* [GameAnalytics](/main/general-info/analytics/gameanalytics.md)
* [ByteBrew](/main/general-info/analytics/bytebrew.md)
* [Adding custom events and consent](/main/general-info/analytics/custom-events.md)
* [Troubleshooting](/main/general-info/analytics/troubleshooting.md)
