> ## Documentation Index
> Fetch the complete documentation index at: https://confidence-auth-testing.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Conditional Targeting Rule

> Learn how to create a conditional targeting rule to assign variants to users based on criteria and percentage allocation.

**Create a Conditional Targeting Rule**

Learn how to create a conditional targeting rule to assign variants to users based on criteria and percentage allocation.

[Conditional targeting rules](/docs/capabilities/flags/define-rules.md#conditional-targeting-rules) assign variants to users based on conditions and percentage allocation.

## Create a Conditional Targeting Rule

To create a conditional targeting rule, follow these steps.

**1. Go to Confidence and select Flags on the left sidebar**

**2. Go to the flag you want to add a rule to**

**3. Click the add rule button in the Rules section**

**4. Select Create conditional targeting rule**

**5. Step 1: Add a description (optional)**

Describe why you're adding this rule. This helps others understand the purpose and intended effect.

**6. Step 2: Define the targeting**

* **Serve**: Select the variant to serve to matching users.
* **To**: Set the percentage of traffic that should receive the variant (0-100%).
* **Of**: Select the attribute to use for randomization.
* **Matching**: Define conditions based on context attributes, or select **Any context** to match all users.

**7. Step 3: Choose environments**

Select whether the rule applies to all environments or only specific environments. This step only appears if you have more than one environment.

**8. Click Create and activate**

The rule is created and immediately active. To create without activating, select **Create as draft** from the dropdown menu next to the button.

Traffic matching your conditions receives the variant according to the percentage you defined.

## Related Resources

> **[Rules Reference](/docs/capabilities/flags/define-rules.md)**
>
> Deep dive into rule types and configuration

> **[Create Individual Targeting Rules](/docs/capabilities/flags/create-individual-targeting-rule.md)**
>
> Force specific variants for testing

> **[Reorder Rules](/docs/capabilities/flags/reorder-rules.md)**
>
> Manage rule priority and order

> **[Define Audience](/docs/capabilities/segments/define-audience-criteria.md)**
>
> Configure targeting criteria
