# Reusable Targeting with User Segments

A User Segment is a reusable set of users defined by conditions. You define a segment once and reuse it to target Feature Gates and Dynamic Configs. This tutorial creates a segment for internal users and then uses it in a new feature gate.

## Step 1: Creating a segment

Navigate to the **Segments** tab in the console:

![Segments tab showing list of existing conditional and ID list segments](https://docs.statsig.com/images/guides/first-segment/175979144-57bbb812-5ea0-429b-b57f-1634b16c5e32.png)

Click **Create New** and name the segment **Internal Stakeholders**:

![Create new segment modal with Internal Stakeholders name entered](https://docs.statsig.com/images/guides/first-segment/175979762-f19a7a10-87ae-47c2-bddd-eaef26137385.png)

There are two types of segments:

* **Conditional Segments**: operate on conditions similar to Feature Gates and Dynamic Configs
* **ID Lists**: accept a predefined list of userIDs or a specific customID

Select **Conditional** and click **Create**.

Add a condition to target users on internal environments:

![Add new rule dialog targeting environment tiers development and staging](https://docs.statsig.com/images/guides/first-segment/175980491-beb329d2-2bbe-4e39-b493-0f59cdb9a66d.png)

Unlike a Feature Gate, a segment rule has no pass percentage. A segment represents all users matching its conditions. When you create a Feature Gate rule based on a segment, you configure the pass percentage on the gate rule.

Add another condition to the same rule. Click **Add more conditions** and add an **email contains any of** condition to target internal employees:

![Add condition dialog requiring email domains statsig.com or statsig.io](https://docs.statsig.com/images/guides/first-segment/175982618-13336e7f-9e72-4c73-9e58-81f86a7fa6a9.png)

:::note
When you add another condition to the same rule, both conditions must pass, because Statsig evaluates them as an AND operation.\
To create multiple conditions where any of them can pass as an OR operation, add a new rule.
:::

Select **Save Changes**. Your segment should look like this:

![Segment rules summary showing environment tier and email conditions combined](https://docs.statsig.com/images/guides/first-segment/175982596-1ed7ea2f-40b5-4773-be7f-4765e889c3d0.png)

## Step 2: Using a segment

Create a gate for the new feature, "Landing Page Redesign". Navigate to **Feature Gates** and click **Create New**.

![Create new feature gate modal naming Landing Page V2](https://docs.statsig.com/images/guides/first-segment/175983618-973a9f36-e1c0-4fd6-9b4a-b97fe658156f.png)

Gate the feature to internal stakeholders using the segment you created. Click **Add New Rule**:

![Add new rule dialog selecting User is in Segment for Internal Stakeholders](https://docs.statsig.com/images/guides/first-segment/175983743-cfe46147-2934-4393-b4aa-3335e55c3502.png)

Select **Save Changes**.

![Feature gate rules showing Internal Only condition referencing the segment](https://docs.statsig.com/images/guides/first-segment/175983838-e40b4284-af26-4e40-83fc-f2350d9d6fb1.png)

## Step 3: Test the gate

Enter a user in the test gate console. The gate only passes if the user has an email ending in `statsig.com` or `statsig.io` AND a `development` or `staging` environment tier. If you remove either condition, the gate fails.

```
{
  email: 'tore@statsig.com',
  statsigEnvironment: {
    tier: "development"
  }
}
```

![Test gate console showing a passing internal user example](https://docs.statsig.com/images/guides/first-segment/127705951-6813bb6e-0ae7-44a2-8db3-421e11e54c5c.png)

You can reuse this segment in any number of Feature Gates or Dynamic Configs to control internal feature access during development.
