skills/abtesting/abtesting-mobile/SKILL.md
Mobile A/B: Firebase Remote Config, Optimizely, Statsig, app store experiments, staged rollout
npx skillsauth add alphaonedev/openclaw-graph abtesting-mobileInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill handles A/B testing for mobile applications using tools like Firebase Remote Config, Optimizely, Statsig, and app store experiments. It focuses on feature flagging, staged rollouts, and canary releases to optimize user experiences.
Use this skill when you need to run experiments on mobile apps, such as testing UI changes, feature toggles, or gradual rollouts. Apply it for apps on iOS/Android to minimize risks, gather data-driven insights, or comply with app store guidelines for experiments.
To set up an A/B test, first authenticate with the service, then define parameters in a config file, fetch values in your app code, and monitor results. For Firebase, use the CLI to update configs; for Optimizely, initialize the SDK early in your app lifecycle. Always wrap experiments in try-catch blocks for error resilience. Pattern: Load config → Assign variants → Track events → Analyze data.
For Firebase Remote Config:
firebase rc:fetch --token $FIREBASE_API_KEY to fetch parameters.https://firebaseremoteconfig.googleapis.com/v1/projects/{projectId}/remoteConfig with JSON body like {"parameters": {"feature_flag": {"defaultValue": {"value": "true"}}}}.let remoteConfig = RemoteConfig.remoteConfig()
remoteConfig.fetch { status, error in
if status == .success { remoteConfig.activate() }
}
For Optimizely:
optimizely project create --apiKey $OPTIMIZELY_API_KEY --name "MobileExperiment".https://api.optimizely.com/v2/experiments to list experiments.OptimizelyManager.getInstance().optimizely.start { userId, attributes ->
val variation = optimizely.decide(userId, "experimentKey")
// Apply variation
}
For Statsig:
statsig config set --key $STATSIG_API_KEY --feature "newFeature" --value true.https://api.statsig.com/v1/evaluate with body {"userID": "123", "featureKey": "feature"}.import Statsig from 'statsig-react-native';
Statsig.initialize('your-sdk-key').then(() => {
const value = Statsig.checkGate('feature_gate');
});
Integrate by adding SDKs via package managers (e.g., pod 'Firebase/RemoteConfig' for iOS or implementation 'com.optimizely.ab:android-sdk:4.0.0' for Android). Use environment variables for auth: set $FIREBASE_API_KEY in your CI/CD pipeline. For config formats, use JSON files like:
{
"parameters": {
"color_scheme": {
"defaultValue": { "value": "blue" },
"description": "A/B test for app theme"
}
}
}
Ensure apps handle offline scenarios by caching configs. For multi-tool setups, prioritize Firebase for simple flags and Optimizely for complex experiments.
Handle authentication errors by checking for 401 responses and retrying with refreshed tokens. For Firebase, catch NSError with code 3 (network error) and fallback to default values. In code:
try {
remoteConfig.fetchAndActivate { status, error in
if let error = error { print("Error: \(error.localizedDescription)") }
}
} catch { print("Fetch failed: \(error)") }
For Optimizely, log decision errors and use a default variation. Common issues: Invalid API keys—verify with echo $OPTIMIZELY_API_KEY; Network failures—implement exponential backoff.
Example 1: Set up a staged rollout for a new feature using Firebase.
$FIREBASE_API_KEY, run firebase rc:set --project myapp --params '{"rollout_percent": 50}', then in app code, fetch and check the value to enable the feature for 50% of users.Example 2: Run an A/B test with Optimizely for button color.
optimizely experiment create --apiKey $OPTIMIZELY_API_KEY --key "buttonColorTest" --variations '["red", "blue"]', integrate SDK, and in code, use the decided variation to set the button color and track clicks.tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui