# Segments

The **Customer Segments** feature lets you group your customers based on different factors, so that you can run more targeted marketing campaigns and personalize the content on the storefront.

In the **Segments** module, you can create, edit and manage the segments in your system.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-36f04f2909d8015844d228a84f9d94bf46797978%2Fsegments.png?alt=media" alt="Segments"><figcaption><p>Segments</p></figcaption></figure>

## Creating a segment

To create a customer segment follow these steps:

1. Go to the **Customer Management -> Segments** and choose **Create New Segment**.
2. In the **Details** tab, choose the site you want the segment to apply to and provide the basic details, such as id, name, and description.

{% hint style="warning" %}
You can set up a customer segment ID in the **Id** field. Otherwise, a unique ID is automatically generated when the segment is created.
{% endhint %}

3. To instantly activate the segment, switch the **Active** toggle option on. Otherwise, toggle is off by default. Turn it on once you're ready.
4. **Save** the segment to create an instance in the system and be able to edit it further.

### Assigning products/categories

If you want to use the segment, for example, to serve some specific marketing campaign and promote some products or specific categories of products, you can connect them to the created segment.

1. Go to the **Products/Categories** tab.
2. From the available products/categories, select the ones you want to assign to the segment. The items you choose appear in the **Selected Objects** panel.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-8a758c9de82edd537fc21694235256260b227a36%2Fsegment_products.png?alt=media" alt="Segment products"><figcaption><p>Segment products</p></figcaption></figure>

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-1ccd82379dee65290f4f8e5c71a0a841a4f93d34%2Fsegment_categories.png?alt=media" alt="Segment categories"><figcaption><p>Segment categories</p></figcaption></figure>

You can assign multiple products and categories at once.

3. Save your selection.

### Adding coupons

Segments can be connected with discount coupons. You can assign a coupon to a segment to offer a special price or discount for the assigned products/categories to the segment members only.

If you've assigned some specific products or categories to the segment, a coupon is valid only for these items.

1. Go to the **Coupons** tab. There is a list of the available coupons. The list excludes the coupons that have any category restriction.
2. Choose a coupon code from the list to apply it to the segment. The selected coupons appear in the selected coupons panel.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-3cddc48948b9aae47053bbb59e4999ceaa941ab4%2Fsegment_coupons.png?alt=media" alt="Segment coupons"><figcaption><p>Segment coupons</p></figcaption></figure>

3. Save to confirm your choice.

You can select several coupons for a segment. At cart level, customers are able to apply all the coupons.\
The assigned coupon works only for the products/categories defined in the segment and is valid only for the customers that are the segment members. Also, the coupon is legal entity aware, which means that if a customer belongs to more than one legal entity, the coupon applies only to the legal entity chosen for the segment.

{% hint style="success" %}
*Applying segment-related coupons to a cart*

A customer belongs to several customer segments that have different products assigned. A customer receives a coupon related to the *Bosch* segment that applies a discount only to the defined products. The customer shops for Bosch products in your online store but also decides to buy some other items, assigned to a different segment than *Bosch*. When they apply the coupon code in a cart, the coupon is validated and the related discount applied only to the Bosch products, excluding the other purchased items.
{% endhint %}

### Assigning members

When creating a segment, you can add the existing customers and assign them as segment members.

1. Go to the **Members** tab and choose **Add New Member**.
2. Find and select the relevant customers and confirm your selection with the **Add Member**.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-ee1d0ccfc4fbbf0b8fd417473873887811735087%2Fsegment_members.png?alt=media" alt="Segment members"><figcaption><p>Segment members</p></figcaption></figure>

If one customer is assigned to different companies, you can choose which one you want to add to your segment.

All the assigned customers are visible in the list.

<figure><img src="https://3057647601-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbTY7EwZtYYQYC6GOcdTj%2Fuploads%2Fgit-blob-eec3ff0fdb6484f217f81158c2ddfa28cade37fe%2Fsegment_members_list.png?alt=media" alt="Segment members list"><figcaption><p>Segment members list</p></figcaption></figure>

{% hint style="info" %}
The segment information is also visible on the customer level - if a customer is assigned to a segment, you can see the associated segment in the customer details page.
{% endhint %}

3. Save changes to the segment.

{% hint style="warning" %}
A storefront can consume the segment information and can display only the dedicated products/categories for the logged in customers that are the segment members. For details on how to connect segment information on your storefront, see the [Customer Segments Tutorial](https://app.gitbook.com/s/d4POTWomuSS7d3dnh4Dg/api-guides/companies-and-customers/customer-segments/segments).
{% endhint %}

## Removing products/categories

To remove a product or a category from segment assignment, go to the **Products/Categories** tab and choose the **x** button next to the selected object. The object is no longer connected to the segment.

## Unassigning customers

To remove a customer from segment assignment, go to the **Members** tab, and choose the **x** button next to the selected customer.\
You can also remove several customers at once by selecting the relevant checkboxes next to the chosen customers and choosing the **Delete** button.
