For the complete documentation index, see llms.txt. This page is also available as Markdown.

custom events

Adding a new analytics event

The included event list is automatic, but adding a new event requires three changes.

1

Add the event name

Add the stable event name to:

AnalyticsEventNames

Example:

public const string TutorialCompleted = "tutorial_completed";
2

Add the schema

If Unity Analytics schema provisioning is required, add the event and its parameters to:

AnalyticsSchemaCatalog

Define:

  • event name;

  • description;

  • parameter names;

  • parameter types;

  • parameter descriptions.

Parameter names must match the names used by the runtime event.

3

Emit the event

Send the event from the relevant runtime system through:

IAnalyticsService

The event is then routed to the selected provider.

Firebase and ByteBrew can send a new generic event without provider-specific mapping.

GameAnalytics sends generic events as design events unless the event requires special progression or ad mapping.

After adding a Unity Analytics schema, run:

HomeDesignMatch3Kit > Settings > Analytics Schema Setup > Populate Events

Run the wizard for every UGS environment where the schema is required.

Enable Analytics is the main kit-level collection switch.

The game initializes the selected provider and then applies the value of:

GameSettings.enableAnalytics

For a production privacy flow:

1

Keep analytics disabled before consent.

2

Display the appropriate privacy or consent UI.

3

Enable analytics only after the user grants consent.

4

Disable analytics if consent is rejected or withdrawn.

The runtime service exposes:

IAnalyticsService.SetDataCollectionEnabled(bool enabled);