Skip to main content

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.

info

Make sure you're using the latest version of the GA SDK for your game engine.

  1. Initialize the SDK. Call the SDK’s Initialize method at app startup. Remote Configs are fetched during initialisation or at the first explicit fetch.

  2. 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
    }
  3. 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.Json or 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 OfferBundleSettings to match your JSON structure.

  4. Handle missing values gracefully. Always provide sensible default values so the game behaves correctly if a configuration is missing or the user is offline.

info

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.