How to Setup GameAnalytics
Use this guide to configure the GameAnalytics SDK — the analytics
backend used across GorodiskiGames projects. Based on the project's
GameAnalytics settings asset at
Assets/Resources/GameAnalytics/Settings.asset.
Architecture Context
- GameAnalytics identifies your app with a per-platform Game Key and Secret Key pair, issued when you register the app (as an Android build and an iOS build — two separate entries) in the GameAnalytics dashboard.
- Both keys live in a single settings asset,
Assets/Resources/GameAnalytics/Settings.asset, edited through the in-editor Window → GameAnalytics → Select Settings panel rather than by hand — the asset also tracks which organization/studio/game the project is currently linked to, and per-platform build version numbers it reports alongside events. - Once configured, the SDK auto-initializes from this asset — there's no separate manual init call to wire up elsewhere in code for the keys themselves.
Pre-Setup Checklist
- A GameAnalytics account, with your app registered once per platform you ship (Android and iOS get separate Game Key / Secret Key pairs, even though it's "the same app").
- The GameAnalytics Unity SDK imported (
Assets/GameAnalytics/).
Main Procedure
Step 1: Open the GameAnalytics Settings Panel
Window → GameAnalytics → Select Settings in the Unity Editor. This
opens (and lets you edit) the Settings.asset described above.
Step 2: Sign In and Link Your Game
The panel walks you through signing in to your GameAnalytics account and selecting (or creating) the organization / studio / game entry this project should report events under — this is what populates the Organization/Studio/Game fields on the settings asset.
Step 3: Confirm the Game Key / Secret Key Per Platform
Once linked, the panel pulls down the real Game Key and Secret Key for each platform automatically — you shouldn't need to type these in by hand. Double check both an Android and an iOS entry exist if you ship both platforms; a project only linked for one platform will silently have no analytics on the other.
Step 4: Validate
Run the game from the Editor with Info Log (Editor) enabled on the settings asset, and confirm GameAnalytics logs show events being queued and submitted rather than authentication errors (a key mismatch shows up here immediately).
Common Edit Recipes
Recipe A: Add a New Custom Event
Call the relevant GameAnalytics.NewDesignEvent(...) /
NewBusinessEvent(...) / NewProgressionEvent(...) API from wherever the
event should fire in code — no settings-asset changes are needed for a
new event, only for changing which app/keys events report against.
Recipe B: Re-Point the Project at a Different GameAnalytics App
Re-open Window → GameAnalytics → Select Settings, sign in, and select a different organization/studio/game — this overwrites the Game Key/Secret Key pair and linkage fields on the settings asset for you.
Troubleshooting
- No events show up in the GameAnalytics dashboard. Check the Settings asset actually has a Game Key/Secret Key pair for the platform you're testing on — a project linked only for one platform reports nothing on the other.
"GameAnalytics: REMEMBER THE SDK NEEDS TO BE MANUALLY INITIALIZED NOW"warning in the Console during debug builds. This project turns that warning off in normal debug play viaGameConfig.SendEventsFromDebugBuild— set ittrueif you actually want debug builds to send real events (and see the warning go away as a side effect), or ignore the warning if you don't.- Events reported under the wrong app/organization. The settings asset was linked to the wrong GameAnalytics game at some point — redo Step 2 against the correct one.