Firebase A/B测试:重复运行同实验且变体数量不同时原有变体的变化
Great question—let’s break down exactly how this works, since Firebase’s user allocation logic depends on a few key details.
Core Background: How Firebase Assigns Users
Firebase A/B Testing uses a deterministic hashing system based on two critical pieces of data:
- The user’s unique ID (either their authenticated user ID or anonymous ID, depending on your setup)
- A unique "seed" tied directly to the specific experiment you create
This means a user will always get the same variant in the same experiment, but their allocation can shift across different experiments—even if you reuse the same Remote Config parameter name.
Your Scenario: Two Possible Outcomes
Let’s cover the two most common ways you might re-run the experiment, and what happens to your original Var B users in each case:
1. You create a brand new experiment (same Remote Config parameter, new experiment entry)
If you stop the original 3-variant experiment and build an entirely new 2-variant experiment (Control + Var B, 50/50 split), Firebase will assign this new experiment a unique seed.
When the new experiment goes live:
- The 33.3% of users originally assigned to Var B will have their ID hashed with this new seed. This means 50% of them will be reassigned to Control, and 50% will stay in Var B—so yes, a portion will end up in a different variant.
- The same random reallocation applies to users who were in Control or Var A in the original experiment.
2. You modify the original experiment (remove Var A, adjust traffic split) and restart it
If you instead edit the existing experiment (delete Var A, set Control and Var B to 50% each) and restart it, the experiment’s original seed remains intact.
Here’s how allocation plays out here:
- Original Control users (0-33.3% of the hash range): Still fall within the new Control range (0-50%), so they stay in Control.
- Original Var A users (33.3-66.6%): Now split—those in the 33.3-50% range move to Control, while those in 50-66.6% shift to Var B.
- Original Var B users (66.6-100%): Fall entirely within the new Var B range (50-100%), so they will stay in Var B with 100% certainty.
Pro Tip: Keeping Original Var B Users in Place
If your goal is to ensure all users who were in Var B stay there in the updated experiment, modifying the original experiment (option 2) is the most reliable approach. Alternatively, if you must create a new experiment, you could use Firebase’s user targeting to:
- Exclude users who were in Var B from the Control variant, or
- Force-assign those users to Var B using custom user properties (you’d need to have tracked their original variant assignment first)
Hope that clears up the confusion!
内容的提问来源于stack exchange,提问作者iamronak

