# Segment Rules

Once you have created a segment the next step is to add the rules or target individual visitor. If the visitor customer\_id is known and if you want to include or exclude them from the segment then click on "Add user targets" button.

![](/files/-MXqwH5pSZaWjzpa_3A8)

Enter the visitor customer\_id whom you want to include or exclude from the segment.

![](/files/-MXqx11cYeaV_dXVX9iZ)

Once all the details are filled you can add the rules for the segment

![](/files/-MXqy3Ib5htd6DMwxRis)

## Targeting visitors based on rules

To add the rules click on "Add rules"

![](/files/-MZCskFq1D4vBMGqShHJ)

Each rule has three parts:  an attribute, an operator and the value/s. For example, if you want to target a group of visitors from India then you can have a rule as Country  IS\_ONE\_OF  India

![](/files/-MZCtOLqK-_CF8nUmFVg)

A rule can have multiple conditions where the visitors need to satisfy all the conditions. For example, if you want to target a group of visitors from India and the device type is Desktop then you can have a rule as Country  IS\_ONE\_OF  INDIA and Device Type IS\_ONE\_OF Desktop

![](/files/-MZCwjLNpBRBCo576e5y)

Finally click on Save Changes button in order to apply the changes to the visitor segment

![](/files/-MZIttELeIJW1hjrtL7A)

Follow the below steps, which makes you to write the rules easier:

* To copy a rule, click on the copy icon above the rule&#x20;

![](/files/-MZCyKHNRfKUDvtWNFcl)

* To delete a rule, click on the delete icon above the rule&#x20;

![](/files/-MZCzcXBMI_w0LyDCCV9)

* To add a new rule click on the Add  button

![](/files/-MZD-NNWEIEGWjkpBYem)

* To copy a condition, click on the copy icon beside the condition&#x20;

![](/files/-MZD-x_cl1bz2PIBCR3Q)

* To delete a condition, click on the delete icon beside the condition&#x20;

![](/files/-MZD04KCa2TriMhwf6xa)

* To add a new condition click on the "+" icon which is present beside the last condition

![](/files/-MZD0_J2L0Sz0wQNnChT)

* Once the segment has been created, you can use that segment in the experience rule engine to target a particular group of visitors.

![](/files/-MZIpUMxt2IE9HkvLxpH)

​


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.customfit.ai/segments/segment-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
