# 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](https://newpanel.docs.emaillabs.io/en/contacts/dynamic-segments-messageflow-segments "mention") section.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://newpanel.docs.emaillabs.io/en/add-ons-and-extensions/messageflow-segments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
