Skip to content

Schema Generation

The SDK includes a Unity build processor that automatically generates an event schema file every time you build your game. This schema describes every analytics event class in your project and is what the PlayOps dashboard uses to validate and document your events.

What is generated

After a Unity build, you will find a file at:

[ProjectRoot]/[Output]/TactileAnalytics/{ProductName}-{Version}-{BuildNumber}-analytics-schemas.json

The filename includes your app’s product name, version, and build number so you can track which build produced which schema.

This file lists every class decorated with [TactileAnalytics.EventAttribute], along with:

  • The event name
  • Each property name, type, and description
  • Whether each property is required or optional
  • A schema hash used for version tracking

When it runs

The build processor runs automatically as a post-process step after every build. It is implemented as a IPostprocessBuildWithReport that fires after the Unity build pipeline completes.

Exporting without a build

You can also generate the schema file on demand from the Unity Editor without performing a full build:

  1. Open PlayOps → Tactile Analytics → Export Analytics Schema from the menu bar.
  2. The schema is written to the same [ProjectRoot]/[Output]/TactileAnalytics/ folder using your active build target, and the containing folder opens automatically.

This is useful for quick iteration — you can verify your event definitions are correct before committing to a full build.

Schema file format

The generated file is a JSON array. Each entry describes one event:

[
{
"eventName": "levelCompleted",
"schemaHash": "a3f7c2...",
"schemaHashBasis": "levelCompleted:levelName,starsEarned,boostersActive,elapsedSeconds?",
"category": "Progression",
"description": "Fired when the player successfully finishes a level.",
"properties": [
{ "name": "s_param1", "mappedTo": "levelName", "type": "string", "required": true, "description": "The level identifier." },
{ "name": "i_param1", "mappedTo": "starsEarned", "type": "int", "required": true, "description": "Stars earned (0–3)." },
{ "name": "b_param1", "mappedTo": "boostersActive","type": "bool", "required": true, "description": "Whether boosters were active." },
{ "name": "d_param1", "mappedTo": "elapsedSeconds","type": "double", "required": false, "description": "Elapsed time in seconds." }
]
}
]

Property names in the payload use compact positional names (s_param1, i_param1, etc.) to minimise payload size. The schema maps these back to your C# property names.

What to do with the schema file

After generating the schema, upload it to the PlayOps dashboard. See Uploading Schemas.