> For the complete documentation index, see [llms.txt](https://docs.emaillabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emaillabs.io/en/add-ons-and-extensions/messageflow-segments.md).

# MessageFlow Segments

MessageFlow Segments is an advanced segmentation mechanism that allows for the automatic grouping of contacts based on their attributes, behaviors, and interactions. Unlike static segments, a dynamic segment is based on a set of rules, not a fixed list. This means that the recipient group is rebuilt just before a campaign is sent, ensuring it is always up-to-date.

{% hint style="warning" %}
**Important information:** The availability of MessageFlow Segments and the use of custom events via the API may depend on your plan. To confirm availability, please contact our support.
{% endhint %}

### **Key benefits of dynamic segmentation**

* **Real-time targeting:** React to the latest recipient actions, such as abandoning a cart or interacting with a specific campaign.
* **Automation and time savings:** Once defined, a segment automatically maintains an up-to-date contact list, eliminating the need for manual imports.
* **Deep personalization:** Create precise target groups by combining declarative data (e.g., city) with behavioral data (e.g., last website visit).

### **Data sources for segmentation**

The segmentation engine can build rules based on four main types of data:

1. **Custom fields (declarative data):** All standard and custom attributes assigned to a contact, e.g., `Email`, `FirstName`, or custom fields like `City` or `Age`.
2. **Visits (website activity):** Data about interactions with your website where a tracking script (web tracking) has been implemented. Example data includes the URL of a visited page or the number of visits.
3. **System events:** Events automatically recorded by the EmailLabs platform in response to campaign interactions, e.g., opening a message (`MailOpen`) or clicking a link (`MailClick`).
4. **Custom events (sent via API):** The most flexible option, allowing you to send any events from your systems (CRM, e-commerce) to EmailLabs. This enables segmentation based on actions like `product_purchased`, `webinar_registration`, or `last_login`, along with their detailed attributes.

You can find detailed instructions for creating and configuring segments in the [Dynamic Segments (MessageFlow Segments)](/en/contacts/dynamic-segments-messageflow-segments.md) section.
