> 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.

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MXqZMApI40r-eluX48a%2F-MXqwH5pSZaWjzpa_3A8%2Fimage.png?alt=media\&token=0e741948-31c4-46e7-a3b7-754c90a8842a)

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

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MXqwcKwmEybdJgFxZW4%2F-MXqx11cYeaV_dXVX9iZ%2Fimage.png?alt=media\&token=ba2a93c4-54a1-4d5f-80f3-710566228d72)

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

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MXqwcKwmEybdJgFxZW4%2F-MXqy3Ib5htd6DMwxRis%2Fimage.png?alt=media\&token=f38aae30-f8b5-4fef-bc9b-341b4c16cf23)

## Targeting visitors based on rules

To add the rules click on "Add rules"

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MZCrb1h7tlCAOkhf3Rz%2F-MZCskFq1D4vBMGqShHJ%2Fimage.png?alt=media\&token=d40df693-c5e6-4c2b-95a9-4bd6a314f901)

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

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MZCrb1h7tlCAOkhf3Rz%2F-MZCtOLqK-_CF8nUmFVg%2Fimage.png?alt=media\&token=414b242b-60a7-4717-9b45-4ad71af33392)

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

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MZCwKR9-mRGfOwTOnjr%2F-MZCwjLNpBRBCo576e5y%2Fimage.png?alt=media\&token=aa3299b9-8403-4845-8baf-b6a134211ea1)

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

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MZIrcBKgR_IxFeEYNb9%2F-MZIttELeIJW1hjrtL7A%2Fimage.png?alt=media\&token=82314eb4-f3ea-478e-8442-0329e5f64f65)

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;

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MZCwKR9-mRGfOwTOnjr%2F-MZCyKHNRfKUDvtWNFcl%2Fimage.png?alt=media\&token=d5157ddc-4540-47fb-8498-cb8b212e6823)

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

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MZCyQyjSwV1G1DGkIHJ%2F-MZCzcXBMI_w0LyDCCV9%2Fimage.png?alt=media\&token=f9dca5e9-9c26-4e04-a3d5-6fbc3f123ec2)

* To add a new rule click on the Add  button

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MZCyQyjSwV1G1DGkIHJ%2F-MZD-NNWEIEGWjkpBYem%2Fimage.png?alt=media\&token=cd9c837c-8c37-47e5-b4c8-0fe14ecca489)

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

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MZCyQyjSwV1G1DGkIHJ%2F-MZD-x_cl1bz2PIBCR3Q%2Fimage.png?alt=media\&token=e2f07bd7-d725-4b7a-8990-f49b414223e6)

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

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MZCyQyjSwV1G1DGkIHJ%2F-MZD04KCa2TriMhwf6xa%2Fimage.png?alt=media\&token=08da65a9-0d4e-4faf-9421-9f19f06d49a5)

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

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MZCyQyjSwV1G1DGkIHJ%2F-MZD0_J2L0Sz0wQNnChT%2Fimage.png?alt=media\&token=683a8b65-efdd-443f-92fe-921012496f77)

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

![](https://1136256215-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MUgAFLO61VraHX8jwLt%2F-MZInUGKmsu0HGiOC28L%2F-MZIpUMxt2IE9HkvLxpH%2Fimage.png?alt=media\&token=84bb2087-de22-4528-8113-39566c5f1e5b)

​
