---
title: Contact segmentation
related:
  - https://docs.kentico.com/k82/on-line-marketing-features/contact-management/improving-custom-macro-performance-in-scoring-and-contact-groups.md
  - https://docs.kentico.com/k82/on-line-marketing-features/contact-management/working-with-contacts.md
  - https://docs.kentico.com/k82/on-line-marketing-features/contact-management/working-with-contacts/organizing-contacts-into-accounts.md
  - https://docs.kentico.com/k82/macro-expressions/writing-macro-conditions.md
  - https://docs.kentico.com/k82/on-line-marketing-features/on-line-marketing-macros.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

> **Info:** **Kentico EMS required**
>
> Features described on this page require the **Kentico EMS** license.

You can organize [contacts](https://docs.kentico.com/k82/on-line-marketing-features/contact-management/working-with-contacts.md) into segments called **contact groups**. Segmentation allows you to divide your website's visitors and users into groups of people with shared characteristics, which you can then accurately target in your on-line marketing efforts (such as [Email marketing](https://docs.kentico.com/k82/on-line-marketing-features/email-marketing.md)). You can either add contacts to groups manually or set up the system to assign contacts to groups automatically based on conditions.

> **Tip:** **Segmenting contacts using Personas**
>
> [Personas](https://docs.kentico.com/k82/on-line-marketing-features/content-personalization/personas.md) are a different approach to segmenting contacts. _Contact groups_ differ from _personas_ in the following:
>
> - Contacts are assigned to contact groups based on conditions. In personas, you can additionally make use of attributes and activities.
> - Visitors are assigned to the most relevant persona only, while they can be in multiple contact groups at a time.
> - You can assign personas to content (tagging by personas). You can then have the content served to visitors based on their personas.

Contact groups can be site-specific or shared across all websites in the system ([global contact groups](https://docs.kentico.com/k82/on-line-marketing-features/contact-management/allowing-global-contact-management-objects.md)). Contacts can belong to any number of different contact groups.

> **Info:** **Merged contacts in contact groups**
>
> When [merging contacts](https://docs.kentico.com/k82/on-line-marketing-features/contact-management/working-with-contacts/merging-contacts-and-accounts.md), note that only the parent contacts are assigned to contact groups.

You can manage contact groups in the **Contact groups** application.

![Viewing contact groups](https://docs.kentico.com/docsassets/k82/contact-segmentation/viewing_contact_groups.png "Viewing contact groups")

Click **New contact group** to create contact groups.

## Manually adding contacts to groups

To add individual [contacts](https://docs.kentico.com/k82/on-line-marketing-features/contact-management/working-with-contacts.md) to contact groups:

1. Edit a contact group.
2. Open the **Contacts** tab.
3. Click **Add contacts**.
4. Select the contacts and click **OK**.

You can find all contacts in the contact group listed on the **Contacts** tab.

### Adding accounts

You can add entire [contact accounts](https://docs.kentico.com/k82/on-line-marketing-features/contact-management/working-with-contacts/organizing-contacts-into-accounts.md) to groups:

1. Edit the contact group.
2. Open the **Accounts** tab.
3. Click **Add accounts**.
4. Select the accounts and click **OK**.

Adding an account automatically assigns all of the account's contacts into the group. You can find all contacts added via accounts on the group's **Contacts** tab (identified by the Yes value in the **From account** column).

## Removing contacts from groups

To remove individual contacts from contact groups:

1. Edit the contact group.
2. Open the **Contacts** tab.
3. Click **Remove** () next to the given contact.

You can remove multiple contacts using the options below the list:

1. Choose which contacts to remove:
   1. _All contacts_
   2. _Selected contacts_ - mark specific contacts using the checkboxes on the left side of the list.
2. Select the _Remove_ action.
3. Click **OK**.

## Setting up condition based contact groups

Condition based contact groups automatically gather all contacts that fulfill certain criteria (defined through a [macro condition](https://docs.kentico.com/k82/macro-expressions/writing-macro-conditions.md)).

1. Edit the contact group.
2. On the **General** tab, enable **Condition-based contact group**.
3. [Specify the condition](https://docs.kentico.com/k82/macro-expressions/writing-macro-conditions/building-conditions-using-macro-rules.md) in the **Condition** field.
   - If you write the macro condition manually, the expression must return either _true_ or _false_.
4. (Optional) Enable **Scheduled rebuild**. Ensures that the contact group is automatically rebuilt every day by a scheduled task.

   **Rebuilding contact groups**

   Rebuilding ensures that the group only contains contacts that fulfill the current condition. **You only need to rebuild after modifying the group's condition.** When a contact is created or updated, the system automatically checks if the contact fulfills the conditions of contact groups and adds or removes them accordingly. 

   Do not run the recalculation during the peak traffic hours of a live website. Contact group recalculation can be a resource intensive process that may reduce the website's performance. You can change the time of **Scheduled rebuild** in the **Scheduled tasks** application.

   You can manually rebuild the contact group at any time by clicking **Rebuild contact group**.

   ![Creating a condition based contact group](https://docs.kentico.com/docsassets/k82/contact-segmentation/creating_dynamic_contact_group.png "Creating a condition based contact group")
5. Click **Save**.

You can find all contacts added through the condition on the group's **Contacts** tab (identified by the Yes value in the **Condition-based** column).

> **Tip:** **Improving contact group performance**
>
> If you are using custom macro rules, developers can significantly improve contact group performance by [implementing a translation](https://docs.kentico.com/k82/on-line-marketing-features/contact-management/improving-custom-macro-performance-in-scoring-and-contact-groups.md) for these rules.
