Title: FAQ Locale: en URL: https://sensorswave.com/en/docs/feature-gates/faq/ Description: Frequently asked questions about using Feature Gates This article compiles frequently asked questions and answers about using Feature Gates. ## Basic questions ### What is the difference between Feature Gates and A/B tests? **Feature Gates**: - Control the enabling and disabling of features - Used to reduce release risk - No statistical significance testing required **A/B tests**: - Compare the effectiveness of different approaches - Used to validate hypotheses and optimize decisions - Require random grouping and statistical testing See [Feature Gates vs A/B Testing](gates-vs-experiments.mdx) for details. ### When should I use Feature Gates? The following scenarios are recommended for Feature Gates: 1. **Gradual rollout of new features**: Progressively verify stability 2. **Feature degradation protection**: Quickly disable problematic features 3. **Paid feature control**: Permission management across user tiers 4. **Seasonal features**: Temporary features like holiday promotions 5. **User targeting**: Enable features for specific user groups See [Use Cases and Examples](use-cases.mdx) for details. ### Will Feature Gates affect performance? **Impact is minimal**: - The SDK uses local caching to avoid frequent network requests - Configuration updates use incremental push - Rule matching is done locally with millisecond-level response times **Optimization recommendations**: - Keep the total number of Feature Gates under 100 - Use batch queries to reduce call frequency - Preload configurations at application startup ### How long does a Feature Gate configuration take to go live? The SDK checks for configuration updates every 10 minutes. The client takes effect immediately upon receiving the update. **Verification method**: 1. Modify the Feature Gate configuration 2. Wait for the SDK's next configuration update (up to 10 minutes) 3. Or wait for the SDK to automatically update its configuration (every 10 minutes) 4. Verify the new configuration is in effect ## SDK-related ### What happens when the SDK cannot connect to the server? **Fallback strategy**: 1. Uses locally cached configuration (if available) 2. If no cache exists, uses the default value specified in code 3. Logs the event for troubleshooting **Best practice**: ```javascript // Always include fallback logic const isEnabled = await SensorsWave.checkFeatureGate('new_feature'); // checkFeatureGate returns false when configuration is unavailable ``` ### How do I check a Feature Gate in code? **JavaScript**: ```javascript const isEnabled = await SensorsWave.checkFeatureGate('feature_name'); ``` **Go**: ```go user := sensorswave.User{ LoginID: "user_id", } isEnabled, err := client.CheckFeatureGate(user, "feature_name") ``` **Android (Kotlin)**: ```kotlin Sensorswave.getInstance().checkFeatureGate("feature_name") { isEnabled -> // Use isEnabled } ``` **iOS (Swift)**: ```swift Sensorswave.getInstance().checkFeatureGate(key: "feature_name") { isEnabled in // Use isEnabled } ``` See [SDK Integration](sdk-integration.mdx) for details. ### How do I query multiple Feature Gates? Call `checkFeatureGate` for each gate individually: ```javascript const feature1Enabled = await SensorsWave.checkFeatureGate('feature_1'); const feature2Enabled = await SensorsWave.checkFeatureGate('feature_2'); const feature3Enabled = await SensorsWave.checkFeatureGate('feature_3'); ``` > **Note**: The SDK uses local caching, so multiple `checkFeatureGate` calls have minimal performance overhead. ## Configuration and rules ### How do I create a Feature Gate? 1. Log in to the Sensors Wave console 2. Click **Feature Gates** in the left menu 3. Click **New Feature Gate** 4. Fill in basic information and rules 5. Save and publish See [Quick Start](quick-start.mdx) for details. ### What is the rule matching order? Rules are matched from top to bottom. Once the first rule matches, the result is returned immediately without further matching. **Example**: | Order | Rule | Return value | |-------|------|--------------| | 1 | Internal test users | Enabled | | 2 | VIP users | Enabled | | 3 | 10% rollout | Enabled | | — | Default | Disabled | **Recommended order**: 1. Override rules (highest priority) 2. User property rules 3. Subject ID rules 4. Percentage rollout rules (lowest priority) See [Core Concepts - Combining rules](core-concepts.mdx#combining-rules) for details. ### How does percentage rollout Allocation work? **Allocation algorithm**: ``` hash(user_id + gate_key) % 100 **Note**: Rule changes take effect when the SDK next checks for configuration updates. Proceed with caution. ### When are user properties set? User properties need to be set before using Feature Gates: ```javascript // Set user properties SensorsWave.profileSet({ user_level: 'VIP', subscription_tier: 'professional', country: 'CN' }); // Then check the Feature Gate — it will match rules based on user properties const isEnabled = await SensorsWave.checkFeatureGate('vip_feature'); ``` See [User Identification](../data-integration/user-identification.mdx) for details. ## Gradual rollout ### How long does a gradual rollout take? **Typical timeline**: | Phase | User coverage | Observation period | |-------|--------------|-------------------| | Internal testing | 0.1% | 1-2 days | | 1% rollout | 1% | 2-3 days | | 10% rollout | 10% | 2-3 days | | 50% rollout | 50% | 1-2 days | | Full release | 100% | 1-2 weeks | **Total**: 2-4 weeks The timeline can be adjusted based on feature importance and risk level. ### How do I quickly rollback a feature? **Method 1: Modify rules** 1. Go to the Feature Gate detail page 2. Change the percentage rule to 0% 3. Or delete all rules and keep the default value as disabled **Method 2: Disable the gate** 1. Go to the Feature Gate detail page 2. Click the **Disable** button 3. All users immediately see the old feature **Time to take effect**: The SDK updates its cache within 10 minutes ### How do I monitor gradual rollout effectiveness? Use [Segmentation](../analytics/event-analysis.mdx) to monitor these metrics: **Technical metrics**: Error rate, response time, crash rate **Business metrics**: Conversion rate, retention, user satisfaction ### When should I rollback? **Rollback immediately if**: - Error rate increases significantly (> 10%) - Severe bugs discovered - Key metrics decline significantly (> 5%) - Large volume of negative feedback **Proceed cautiously if**: - Minor performance degradation - Small number of user-reported issues - Metric fluctuations within normal range **Continue proceeding if**: - All metrics are stable - Overall positive user feedback - No severe issues ## Management and maintenance ### How do I view Feature Gate usage? 1. Go to the Feature Gate detail page 2. Click the **Data** tab 3. Review: - Covered user count - Check count - Rule hit statistics See [Management and Monitoring - Report data](management-and-monitoring.mdx#report-data) for details. ### How do I clean up unused Feature Gates? **Cleanup steps**: 1. **Remove gate checks from code**: ```javascript // Remove the Feature Gate check and use the new feature directly const recommendations = await getRecommendationsV2(userId); ``` 2. **Remove old code**: ```javascript // You can safely delete the old implementation ``` 3. **Archive the Feature Gate**: Click the **Finish** button in the console 4. **Deploy code**: Deploy the new code with gate checks removed **Cleanup timing**: - Temporary gates: 1-2 months after full release - Confirm the feature is stable and no rollback is needed See [Best Practices - Lifecycle management](best-practices.mdx#lifecycle-management) for details. ### Is there a limit on the number of Feature Gates? **No hard limit**, but we recommend: - Fewer than 100 Feature Gates per project - Regular cleanup of unused gates - Avoid creating a gate for every small change **Reasons**: - Too many gates affect performance - Increased maintenance cost - Code becomes difficult to understand ### Are Feature Gate configurations recorded? **Yes**, all operations are recorded: - Operation time - Operator - Operation type (Create, Edit, Publish, etc.) - Change details **How to view**: 1. Go to the Feature Gate detail page 2. Click the **History** tab 3. View the complete change history See [Management and Monitoring - Change history](management-and-monitoring.mdx#change-history) for details. ## Troubleshooting ### What do I do if a Feature Gate isn't working? **Troubleshooting steps**: 1. **Confirm the Feature Gate has been published**: - Check if the status is **Running** - Gates in Draft status won't take effect 2. **Check if the user meets the rule conditions**: - Verify user properties are correct - Confirm rule configuration is correct 3. **Check the SDK configuration**: - Confirm the SDK has been correctly initialized - Upgrade to the latest version 4. **Check network connectivity**: - Confirm the SDK can connect to the server - Check SDK logs 5. **Wait for configuration updates**: The SDK automatically updates its configuration every 10 minutes. After making changes, wait for the next update to take effect. ### Users see inconsistent Feature Gate states? **Possible causes**: 1. **Rule configuration issue**: - Different users have different properties, matching different rules - Percentage rollout causes some users to be enabled 2. **Caching issue**: - Configuration was just updated; some users still have the old configuration - Wait for the configuration update to take effect (up to 10 minutes) **Solutions**: - Verify rule configuration is correct - Wait for configuration updates to take effect ### What do I do about SDK errors? **Check error logs**: ```javascript // Enable debug mode SensorsWave.init('YOUR_SOURCE_TOKEN', { debug: true // Output detailed logs }); ``` **Common errors**: | Error message | Cause | Solution | |---------------|-------|----------| | `Invalid API key` | Incorrect API key | Verify the API key is correct | | `Network error` | Network connection failure | Check network connection and firewall settings | | `Gate not found` | Feature Gate doesn't exist | Verify the gate name is correct | | `User not identified` | User not identified | Call `SensorsWave.identify()` to identify the user | ### How do I contact technical support? If you encounter issues you cannot resolve: 1. **Check documentation**: - Read relevant documentation - Review the FAQ 2. **Contact the support team**: - Email: wave-support@sensorsdata.cn 3. **Provide information**: - Detailed problem description - Error messages and logs - SDK version information - Steps to reproduce ## Other questions ### Can Feature Gates be used on mobile? **Supported**: - Android SDK - iOS SDK See [SDK Integration](sdk-integration.mdx) for details. ### Do Feature Gates support offline mode? **Partially supported**: - The SDK caches the last retrieved configuration - Uses cached configuration when offline - Uses the default value specified in code when no cache is available **Recommendations**: - Always specify a default value - Preload configurations at application startup ### Can Feature Gates be used in backend services? **Yes**: Feature Gates are not only for frontend use but also for backend services: - Server-side SDKs (Go, Java, Python, etc.) - Microservice architectures - API degradation **Example**: ```go // Check if the recommendation service is enabled user := sensorswave.User{LoginID: userId} enabled, err := client.CheckFeatureGate(user, "recommendation_service_enabled") if err != nil { log.Printf("CheckFeatureGate error: %v", err) } if enabled { // Call the recommendation service recommendations := callRecommendationService(userId) } else { // Fallback: return default recommendations recommendations := getDefaultRecommendations() } ``` ### Are there usage limits for Feature Gates? **No strict limits**, but we recommend: - Feature Gate count < 100 - Rule count (per gate) < 20 - Reasonable check frequency (avoid excessive calls) **Beyond recommended values**: - May affect performance - Increases maintenance cost - Consider optimizing and cleaning up ## Next steps If you have additional questions: 1. See [Overview](overview.mdx) for Feature Gate fundamentals 2. Follow the [Quick Start](quick-start.mdx) to create your first Feature Gate 3. Contact technical support for help --- **Last updated**: January 28, 2026