
In this guide, you create and implement your first experiment in Statsig from end to end. There are many types of experiments you can set up in Statsig. This guide walks through the most common one: an A/B test.

By the end of this tutorial, you have:

* Created a new user-level **Experiment** in the Statsig console, with **parameters** set for a Control and Experiment group
* **Checked the experiment** in your application code using the **Statsig Client SDK** `getExperiment` function

## Prerequisites

1. You already have a [Statsig account](https://console.statsig.com/sign_up)
2. You already [installed the Statsig Client SDK](/sdks/quickstart) in an existing application

## Step 1: In the Statsig console

### Create an experiment

1. Log in to the Statsig console at https://console.statsig.com/ and navigate to Experiments in the left-hand navigation panel.
2. Click on the **Create** button and enter the name `Quickstart Experiment` and enter a brief hypothesis. For example, "A new homepage banner will improve engagement."
3. Click **Create**.

### Set up scorecards

In the Experiment Setup tab, fill out scorecards for the metrics you want to track. For this SDK tutorial, leave most settings at their default values.

1. In the **Hypothesis** card, enter a hypothesis for what you are testing: "Showing a homepage banner will increase user engagement, measured by daily\_stickiness."
2. In the **Primary Metrics** card, add a new metric called `daily_stickiness`.
3. Leave the **Secondary Metrics** and **Duration** settings at their default values. For more details on experiment setup, refer to [Creating an experiment](/experiments/create-new).

### Configure groups and parameters

By default, the experiment runs on 100% of users: Statsig assigns 50% to a Control group and 50% to an Experiment group.

1. In the **Groups and Parameters** card, create a parameter called `enable_banner` and select the type as `Boolean`.
2. Set `enable_banner` to `false` for the Control group and `true` for the Experiment group.
3. Click **Save**.
4. Select **Save** in the bottom right to finalize this experiment setup.
5. The experiment isn't live yet. To launch it, select **Start** at the top of the page. This makes production traffic eligible for the experiment.

{% callout type="note" %}
You can't configure experiment parameters and groups after launching an experiment. To test in a staging environment, refer to [using environments](/guides/using-environments/#configuring-environments).
{% /callout %}

## Step 2: In your application code

### Check the experiment

{% callout type="note" %}
This tutorial assumes you have already [installed the Statsig Client SDK](/sdks/quickstart) in an existing application.
{% /callout %}

Use a Statsig Client SDK to check a user's assigned experiment group and parameters in real time. The SDK changes the user's experience according to the assigned variant. In this case, fetch the value of the `enable_banner` parameter created in Step 1.

{% codetabs %}
```tsx Check Experiment
const quickstartExperiment = myStatsigClient.getExperiment(user, "quickstart_experiment");

// the second parameter is the default fallback value if the experiment is not found
if (quickstartExperiment.get("enable_banner", false)) {
  showBanner();
}
```
{% /codetabs %}

In this snippet, users assigned to the Experiment group see the banner. Users assigned to the Control group don't.

You don't need to [hardcode the experiment group name](/experiments/implementation/getting-group) ("Control" or "Experiment") in the code. The Statsig SDK automatically fetches the experiment configuration and returns the correct value based on the user's variant.

## Step 3: Monitor experiment diagnostics

When you run your code, the SDK calls the `showBanner()` function for users in the Test group. Navigate to your experiment in the Statsig console and select the **Diagnostics** tab to see a live log stream of checks and events from your application.

Refer to the [Diagnostics tab documentation](/experiments/implementation/getting-group#rules) for more information.

{% figure %}
![Experiment Diagnostics](/images/guides/abn-tests/b0ab8c0e-4f13-4b2b-bf58-1f8a09d8d4a7.png)
{% /figure %}

## Step 4: Read experiment results

Within 24 hours of starting your experiment, the **Results** tab in the Statsig console shows cumulative exposures and their impact on the scorecard metrics configured in the **Setup** panel.

Here's a sample of what that looks like:

{% figure %}
![Example experiment results](/images/guides/abn-tests/7e203d73-dbf9-4f27-87fb-b05269dd4173.png)
{% /figure %}

## Log custom events and metrics

In this tutorial, you used `daily_stickiness` as the primary metric. Statsig logs this metric automatically, so you don't need to log it explicitly.

To measure other events or custom metrics that occur after the experiment check, log them to Statsig. Continue to the next tutorial to learn how to log custom events and metrics with the Statsig SDK.

### Related guides

* [Initialization techniques for Statsig SDKs](/client/concepts/initialize)
* [Run a device-level experiment](/guides/first-device-level-experiment)
* [Run an experiment on custom unit ID types](/guides/experiment-on-custom-id-types)
* [Configure the Statsig SDK for staging environments](/guides/using-environments)
