> For the complete documentation index, see [llms.txt](https://doc.customfit.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.customfit.ai/segments/segment-rules.md).

# 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)

​
