Use Remote Configs
Use Remote Configs in your code
This section provides integration guidance for developers. The following examples use C# (Unity), but the same pattern applies across supported SDKs (iOS, Android, C++, etc.). For SDK specific integration steps and code examples, see here.
Make sure you're using the latest version of the GA SDK for your game engine.
-
Initialize the SDK. Call the SDK’s
Initializemethod at app startup. Remote Configs are fetched during initialisation or at the first explicit fetch. -
Check readiness before use. Remote Configs may not be immediately available. Use the readiness API to ensure values are fetched:
// Wait until Remote Configs are ready
if (GameAnalytics.IsRemoteConfigsReady())
{
// Ready to fetch config values
} -
Fetch config values.
- Backward-compatible configs (string): use the SDK method to retrieve a string value by key, optionally providing a default if the key is undefined:
string difficulty = GameAnalytics.GetRemoteConfigsValueAsString("difficulty");
string difficultyWithDefault = GameAnalytics.GetRemoteConfigsValueAsString("difficulty", "normal");- Enhanced configs (JSON): call the same method to obtain the JSON payload as a string, then parse it in your code (using
JsonUtility,Newtonsoft.Jsonor platform‑specific JSON parsing):
// Example: fetch JSON config and parse into a class/struct
string configJson = GameAnalytics.GetRemoteConfigsValueAsString("offerBundleJSON", "{}");
OfferBundleSettings settings = JsonUtility.FromJson<OfferBundleSettings>(configJson);Define
OfferBundleSettingsto match your JSON structure. -
Handle missing values gracefully. Always provide sensible default values so the game behaves correctly if a configuration is missing or the user is offline.
When using SDKs that support Enhanced Remote Configs, events sent to GA will include a configurations_v3 array containing the identifier and version for each active Remote Config. Legacy SDKs send full key–value pairs in configurations. This difference is handled automatically by the SDK, but you may see different metadata in the Explore Tool.