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

# firebase

Use Firebase Analytics when the buyer's project already uses Firebase or Firebase/Google Analytics reporting.

## Firebase setup

{% stepper %}
{% step %}

## Import the Firebase SDK

Import the official Firebase Unity SDK.
{% endstep %}

{% step %}

## Import Firebase Analytics

Import the Firebase Analytics package, for example `FirebaseAnalytics.unitypackage`.
{% endstep %}

{% step %}

## Register applications

Register the Android and iOS applications in the buyer's Firebase project.
{% endstep %}

{% step %}

## Download configuration files

Download the platform configuration files.
{% endstep %}

{% step %}

## Add configuration files to Unity

Place the configuration files directly in the Unity project's `Assets` folder:

**Android**

```
google-services.json
```

**iOS**

```
GoogleService-Info.plist
```

{% endstep %}

{% step %}

## Verify file names

Make sure the file names are exact and do not contain suffixes such as `(1)` or `(2)`.
{% endstep %}

{% step %}

## Add the scripting define

```
FIREBASE_ANALYTICS
```

{% endstep %}

{% step %}

## Select Firebase

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

## Firebase IDs and configuration

Firebase project and application identifiers belong in the official Firebase configuration files:

* `google-services.json`
* `GoogleService-Info.plist`

Do not add Firebase IDs to:

* `GameSettings`
* the HomeDesignMatch3Kit source files
* the analytics provider code

The provider:

* checks and fixes Firebase dependencies;
* initializes the default Firebase app;
* keeps analytics collection disabled until enabled by the kit setting or consent flow;
* converts common analytics parameter types;
* sends events through `FirebaseAnalytics.LogEvent`.

The Unity Analytics Schema Setup Wizard is not required for Firebase.

Firebase events are defined by the event names and parameters sent through the Firebase SDK and are inspected in Firebase or Google Analytics reporting.

## Official documentation

* [Firebase for Unity setup](https://firebase.google.com/docs/unity/setup)
* [Firebase Analytics events](https://firebase.google.com/docs/analytics/unity/events)
