Overview
This article explains how to proactively ensure only approved clients ever send Analytics events to your Unity Gaming Services (UGS) project. Using Remote Config and Game Overrides, you can allowlist app versions, platforms, audiences, time windows, and—critically for WebGL—host domains.
The recommended strategy is “deny by default”: start Analytics only when Remote Config explicitly permits it. This prevents:
-
Polluted data
-
Inflated DAU
-
Tier overages
-
Misleading dashboards caused by rogue, test, QA, or legacy builds
It also covers:
-
Environment hygiene (staging vs production)
-
Kill switches for emergency shutdowns
-
Allowlist maintenance across releases
-
WebGL-specific guidance for domain control
Note: Remote Config is preventative, not a security boundary; if a build is ever modified to ignore configuration, plan to rotate environments as a fallback.
Core Principle
Deny by default. Analytics should never start unless Remote Config explicitly allows it.
Remote Config Keys (Preventative Defaults)
| Key | Type | Default | Purpose |
|---|---|---|---|
analytics_enabled |
bool | false | Master gate for starting Analytics |
min_supported_version |
string | N/A | Minimum app version permitted to send events (e.g., “0.5.0”) |
allowed_platforms |
string list | N/A | Platforms allowed to collect/send (iOS, Android, WebGL) |
allowed_domains |
string list | N/A | Approved host domains for WebGL builds |
kill_switch |
bool | false | Emergency global off switch; disables Analytics regardless of other criteria |
Game Overrides (Allowlist Rules)
Enable Analytics only for explicitly approved clients:
-
Version:
appVersion >= current live release -
Platform: must be in
allowed_platforms -
WebGL domain: must be in
allowed_domains -
Audience/time windows: staged rollouts or regional targeting
Client Behavior
-
On startup, fetch Remote Config.
-
If
kill_switch= true → do not start Analytics. -
Start Analytics only if:
-
analytics_enabled= true -
Client meets version/platform/domain criteria
-
-
If Remote Config cannot be fetched, Analytics stays disabled (fail closed).
Release Hygiene Checklist (Before Shipping)
-
Define and publish RC keys with safe defaults (all off).
-
Create allowlist overrides for the exact versions/platforms/domains you intend to launch.
-
Verify in staging:
-
Approved clients → Analytics ON
-
Unapproved clients (old versions, unknown domains) → Analytics OFF
-
Kill switch works → Analytics OFF
-
-
Use staging environment for QA/test builds.
-
Use production environment for live builds only.
-
Document gating rules in your release checklist to prevent bypassing in future builds.
WebGL-Specific Guidance
-
Always require an allowlisted domain.
-
Treat Remote Config gating as the first line of defense (WebGL builds can be copied/mirrored).
-
Default
analytics_enabled= false. Enable only for approved hosts via overrides.
Observability & Monitoring
-
Add dashboard slices for:
appVersion,platform, and (WebGL)domain. - Periodically audit overrides → retire older versions and tighten the allowlist.
Best Practices
-
Default OFF; enable only via Remote Config overrides.
-
Keep a kill switch available for immediate shutdown.
-
Separate staging vs production environments.
-
Review allowlists every major release → tighten as older versions are retired.
Important Limitation
Remote Config is preventative:
-
If a build is modified to ignore/bypass Remote Config → gating is ignored.
-
Mitigation: strong release hygiene and allowlists from day one.
-
If a compromised build is suspected → create a new environment and pause the old one.