Set up an experiment

Perform the tasks needed to set up an experiment. This topic describes how to set up an experiment using a query profile that references the experiment. For the alternative approach of using an Experiment stage in the primary query pipeline, see Use an Experiment stage.

Before you begin

Before you set up an experiment, you must already have:

  • A search app – The key aspect of the search app for experiments is that the search app identifies users in some way. A user ID might be associated with users persistently (this is best) or only for the current session. Searches and subsequent actions by anonymous users aren’t sent through an experiment.

  • A Fusion app – The Fusion app provides the search functionality you want to provide. Below, you’ll modify the app to include an experiment.

  • Data for users to search – The app should have data that users can search and search results that users can interact with. Typically, users will search a single dataset in the sense that different users aren’t given search results from different datasets. But in an experiment, different experiment variants can use data in different collections.

  • Results for users to interact with – Experiment metrics depend on users interacting with search results, for example, clicking on them. A search app uses signals to report the interactions to Fusion.

  • A plan for the experiment – This plan includes which control and variants to compare, the projected traffic, sample sizes, experiment duration, metrics, and decision criteria.

Basically, you need a working system in some environment on which you want to perform experiments, and a plan for experiment variants and for deciding which results are best.

1. Create query pipelines

The primary approach for experiment variants is to have multiple query pipelines. You must create additional query pipelines as needed before creating the experiment.

Tip
You can also vary the collection that is searched and and query parameters, which you do when creating the experiment. In fact, if that is all you are varying, you can define an experiment that uses a single query pipeline. (And you can skip this section.)

You’ll need the following pipelines:

  • Pipeline for the control variant – The first variant in an experiment is the control. The A/B/n experiment metrics compare the control variant pairwise with the other variants. The control variant should probably use the default query pipeline. Here, we assume that is the case.

    Note
    You could modify the configuration of the default query pipeline (which the control variant will use) before the experiment. However, doing so has two disadvantages. First, pairwise comparisons in the experiment won’t be against the status quo. Second, Fusion AI won’t have a baseline of historical signal data to compare against (that comparison lets an experiment reach higher confidence numbers more quickly).
  • Pipelines for other variants – Other variants in an experiment can use other query pipelines, each with different stages and/or that are configured differently. These are "how you might do things differently."

None of these pipelines will include Experiment stages. For the alternative approach of using an Experiment stage in the primary query pipeline, see Use an Experiment stage.

To create query pipelines for non-control variants

Create and configure the additional query pipelines you need for non-control variants. Repeat these steps for each pipeline.

  1. Navigate to Querying Querying > Query Pipelines.

  2. Click Add.

  3. Enter a Pipeline ID (arbitrary name) for the pipeline, and then click Save.

    Add pipeline

  4. Modify the pipeline as desired, for example, by adding, configuring, and reordering stages.

  5. Click Save.

2. Create the query profile and the experiment

In the Fusion UI, you can use either of these equivalent approaches to set up an experiment:

Option A: Create the experiment in the Query Profiles UI

  1. Choose or create a query profile – Choose an existing query profile (for example, the default query profile) or create a new query profile for the experiment.

    To choose an existing query profile:
    1. Navigate to Querying Querying > Query Profiles.

    2. In the left pane, click the query profile you want to use.

    3. Verify that the pipeline, search handler, collection ID, and parameters are correct.

    4. (Optional) Click New params and specify URL parameters to add to all queries for this query profile.

      Use existing query profile

    To create a new query profile:
    1. Navigate to Querying Querying > Query Profiles.

    2. Click New.

    3. Enter a Query Profile ID (an arbitrary name for the query profile).

    4. Choose a pipeline and a collection.

    5. (Optional) Click New params and specify URL parameters to add to all queries for this query profile.

      Create new query profile

  2. Enable experimentation and specify experiment details in the query profile:

    1. Click the checkbox in front of Enable experimentation.

    2. Specify the percent of traffic to include in the experiment.

    3. Click the dropdown arrow, and then click Add Experiment.

      Add experiment in query profile

    4. Enter an arbitrary ID (name) for the experiment.

    5. Verify that the unique ID parameter is correct. It’s the parameter that uniquely identifies each user. The default is userId. Correct the parameter if necessary.

    6. Choose the base collection for signals. Signals resulting from requests that flow through the experiment are stored in the _signals collection associated with this collection.

    7. (Optional) Enter a description for the experiment.

    8. Add variants. Click Add Variant to add each non-control variant in your experiment.

      Add variants in experiment

    9. For each variant:

    1. Enter an arbitrary name. For the first variant, which is the control, Fusion uses the name control. You can change that name if you wish.

    2. Click Specify what varies and specify what varies. Items you select are visible in the variant UI and have a green check mark in the dropdown menu. You can vary the query pipeline, query parameters (URL parameters to add to the query), and/or the collection.

      Specify what varies

    3. (For query parameters) Click New params. In the dialog box, specify the Parameter Name, Parameter Value, and Update Policy for each parameter (append, default, remove, or replace).

  1. Add metrics. For each metric:

  1. Click Add Metric and select the type of metric.

  2. Fill in information for the metric.

    Add metrics in query profile

  1. Click Save to save the experiment.

Option B: Create the experiment in the Experiments UI

You can create the experiment first and reference it from a query profile.

  1. Create an experiment – The experiment defines variants and metrics, as well as the user ID parameter and the base collection for signals:

    1. Navigate to Analytics Analytics > Experiments.

    2. Click New.

    3. Enter an arbitrary ID (name) for the experiment.

    4. Verify that the unique ID parameter is correct. It’s the parameter that uniquely identifies each user. The default is userId. Correct the parameter if necessary.

    5. Choose the base collection for signals. Signals resulting from requests that flow through the experiment are stored in the _signals collection associated with this collection.

    6. (Optional) Enter a description for the experiment.

      Configure experiment in Experiments

    7. Add variants. Click Add Variant to add each non-control variant in your experiment.

      Add variants in experiment

    8. For each variant:

    1. Enter an arbitrary name. For the first variant, which is the control, Fusion uses the name control. You can change that name if you wish.

    2. Click Specify what varies and specify what varies. Items you select are visible in the variant UI and have a green check mark in the dropdown menu. You can vary the query pipeline, query parameters (URL parameters to add to the query), and/or the collection.

      Specify what varies

    3. (For query parameters) Click New params. In the dialog box, specify the Parameter Name, Parameter Value, and Update Policy for each parameter (append, default, remove, or replace).

  1. Add metrics. For each metric:

  1. Click Add Metric and select the type of metric.

  2. Fill in information for the metric.

    Add variants in experiment

  1. Click Save to save the experiment.

  1. Reference the experiment from the query profile – Open the query profile you want to use for the experiment.

    1. Navigate to Querying Querying > Query Profiles.

    2. Click the query profile you want to use for the experiment.

    3. (Optional) If necessary, modify the query profile ID, default pipeline, and/or the search handler. These modifications aren’t related to experiments and are probably not required.

    4. (Optional) Click New params and specify URL parameters to add to all queries for this query profile.

    5. Click the checkbox in front of Enable experimentation.

    6. Specify the percent of traffic to include in the experiment.

    7. Click the dropdown arrow, and then click the experiment name.

      Configure experiment in Experiments

    8. Click Save to save the query profile.

Next step

You’ve set up the experiment. Next, you will run it.