5

Background

Google has published a whole new API and services for A/B testing, using Firebase Analytics and Firebase Remote Config.

The problem

While I do try out the service for other purposes (here and here), I also need to use it for A/B testing.

Thing is, I can't find out how to make it show the needed information for analyzing the results of variants of the experiments.

It just doesn't show (on this website), or I don't look at the right place:

enter image description here

What I've tried

In order to try a single experiment, I did as the tutorial say I should do, including :

  1. Initialization in code is about the same as in the samples :

    boolean isDebug = AppComponentsHelper.isInDebugFlavour(context);
    mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance();
    FirebaseRemoteConfigSettings configSettings = new FirebaseRemoteConfigSettings.Builder().setDeveloperModeEnabled(isDebug).build();
    mFirebaseRemoteConfig.setConfigSettings(configSettings);
    final HashMap<String, Object> defaults = new HashMap<>();
    for (ExperimentType experimentType : ExperimentType.values())
        defaults.put(experimentType.experimentId, experimentType.defaultValues);
    mFirebaseRemoteConfig.setDefaults(defaults);
    
    long cacheExpiration = isDebug ? 0 : TimeUnit.HOURS.toSeconds(1);
    mFirebaseRemoteConfig.fetch(cacheExpiration)
            .addOnCompleteListener(new OnCompleteListener<Void>() {
                @Override
                public void onComplete(@NonNull Task<Void> task) {
                    if (task.isSuccessful()) {
                        mFirebaseRemoteConfig.activateFetched();
                        final FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(context);
                        for (ExperimentType experimentType : ExperimentType.values()) {
                            String experimentVariant = FirebaseRemoteConfig.getInstance().getString(experimentType.experimentId);
                            firebaseAnalytics.setUserProperty(experimentType.userProperty, experimentVariant);
                        }
                    }
                }
            });
    

    This is the enum of ExperimentType:

    public enum ExperimentType {
      PURCHASES_OFFERED_PRODUCTS("purchases_offered_products_1", "Experiment1", new Gson().toJson(new String[]{"something", "something2"}));
    
      public final String experimentId,defaultValues,userProperty;
    
      ExperimentType(final String experimentId, final String userProperty, final String defaultValues) {
          this.experimentId = experimentId;
          this.defaultValues = defaultValues;
          this.userProperty = userProperty;
      }
    

    }

  2. Creating a new user property for each experiment (just one for now).

  3. In remote config screen, add 2 variants (default and conditional).

  4. Upon loading the remote config , calling setUserProperty (see #0), as shown in the tutorial, to point to the current variant's parameter value.

  5. In order to track an event, I called:

    firebaseAnalytics.logEvent(eventName, new Bundle())
    

    One of the calls (only one for now), as you might have guessed is when eventName is "subscription_premium_purchase" .

  6. When running the app, I caused it to use both variants (one for each clean installation, of course).

But as I've shown, I can't find a way to determine which variant caused the event to be called more than the other, for example.

The questions

  1. What might be missing here? What have I done wrong? Why can't I see any variant that I've used?

  2. What is the user property for, anyway? Is it used as a "glue" between Remote-Config and Analytics? What am I supposed to enter in the textbox there (it says "Press 'enter' to apply") ? Doesn't it suppose to show the various variants? Other filters items have "types", yet this one doesn't. There is nothing to choose from the user property. Even when creating a user property, I can't see any settings for it (except for description). I can't even delete it. There is no way to see the conditions I've created in the graph.

  3. Do I need to use BigQuery, perhaps?

  4. I've noticed that the "fetch" function sometimes doesn't get the listener to be called at all. How could it be? Can I add a timeout for this?

Community
  • 1
  • 1
android developer
  • 114,585
  • 152
  • 739
  • 1,270

1 Answers1

0

I think the key confusion here is related to the fact that you don't see your values as auto-complete suggestions when you chose the Experiment user property. This is a feature that is being considered. But if you just type in your Experiment values, it will apply that as a filter on your reporting so you can see how many "subscription_premium_purchase" events were logged by users in one variant versus the other.

Steve Ganem
  • 10,591
  • 2
  • 39
  • 32
  • How? How do I filter by variant? How do I see how many events per each variant there are? I tried to enter one of the values, and showed a single event, but when I tried the other, it showed no events (even though there should be). I will now try easier user-properties values, which will have meaning only in code, and not what I used before. Perhaps some characters are problematic there to put (or it's too long). Too bad I can't add description for each. Also, can you please tell why it sometimes stuck on the "fetch" command ? How can I provide feedback about this service? – android developer Jun 23 '16 at 07:05
  • 2
    I don't understand why it has to be so complex to use this service. It should be much easier: create experiment (with name, description), create variants for it (each has name, description, conditions, variables). And that's it. In the analytics screen (of the graphs), it should automatically show for each experiment, the variants and the events (per variant). It would even be much cooler to be able to configure which event should each experiment focus on, so a single, simple graph would hold exactly what we need to determine which variant is the best. – android developer Jun 23 '16 at 07:14
  • Currently, you have to type the variant value manually into the user property filter in Analytics. We are considering how best to automate all of this, but in the meantime, it requires manual effort. – Steve Ganem Jun 23 '16 at 12:50
  • Can you please consider making an A/B testing category on Firebase, and make it as easy as possible to use (like the procedure I've described) ? It's very annoying to have so many steps that work in this weird way. It all look like a workaround to have A/B testing, using Analytics and RemoteConfigs together. The merging doesn't look natural, and the number of features and clearness is lacking too. But the most important thing now is that on some devices (not all), the "fetch" command is stuck (not calling its callback). I can't even have a timeout or a callback for when it fails. Why is that? – android developer Jun 23 '16 at 13:34
  • I've also noticed that it doesn't show male/female info. How come? Where does it come from? G+ ? – android developer Jun 26 '16 at 07:12