---
updatedAt: 2026-11-11T08:00:58.000Z
agentTools:
  projectIndex: https://docs.esputnik.com/llms.txt
---

# Creating Dynamic Segment

<HTMLBlock>{`
<p align="right" style="color: gray;">
  <a href="https://docs-ua.esputnik.com/docs/stvorennya-umovnih-grup" style="color: gray; text-decoration: none;"><em>
    Read this article in Ukrainian ⮕
  </em></a>
</p>
`}</HTMLBlock>

In eSputnik, you can create dynamic segments based on specific conditions. The group members will change automatically depending on whether the contacts fit the specified parameters or not. This feature can apply to birthday emails, [reactivation emails](https://docs.esputnik.com/docs/customer-reactivation), split between customers and subscribers, etc.

The [Search contacts](https://docs.esputnik.com/reference/searchcontacts-1) API method has no parameter to filter by contact creation date, even though `createdDate` is returned in the response. To isolate contacts created before or after a given date, use [BigQuery export](https://docs.esputnik.com/docs/exporting-data-to-the-bigquery-tables) instead — the `contacts` table includes both `contactId` and `createdDate`.

Membership is recalculated by a background process, so there is no fixed interval and updates can appear with a delay — the larger the segment, the longer a recalculation takes.

A condition based on membership in another segment is calculated as a separate request for each segment it refers to, so a segment assembled from several others takes longer than the same conditions written out in one segment. Recalculation is not immediate either, so when a campaign depends on a heavy segment, recalculate it in advance instead of at the moment of sending.

## How Relative Date Ranges Are Calculated

Relative date conditions are calculated from the moment when the segment is recalculated, not from the start of the calendar day. One relative “day” is a rolling 24-hour interval.

For example, **during next 10 days** starts at the recalculation time and extends 10 × 24 hours into the future. A preceding day is likewise the previous 24 hours. Because the boundary moves with each recalculation, a relative range can return a different count from a range entered as fixed calendar dates.

For a **between X and Y** condition, both bounds are inclusive: the range spans from (now − Y days) to (now − X days) — a window of (Y − X) days. For example, **between 0 and 5** spans the full 5 days up to the current recalculation moment; **between 1 and 5** spans only 4 days, from 5 days ago to 1 day ago, since the most recent day is excluded entirely.

## Adding a Dynamic Segment

> 📘 Preconditions
>
> Before creating a dynamic segment, add [the contact fields](https://docs.esputnik.com/docs/custom-user-fields) and [custom events](https://docs.esputnik.com/docs/creating-events) you plan to segment by.

1. Go to **Contacts → Segments** and click **Add segment**.

<Image src="https://files.readme.io/1a85498e93db3ce705ad078596338c31b83b6d56961e7daa356dc6a1ecaa1600-image.png" align="center" width="80% "  alt="Contact segments page with the Segments tab active and the Add segment button highlighted" />

2. Select the **Dynamic** segment type and click **Create**.

<Image src="https://files.readme.io/9c44297f9756dfe32eba1715d4bc0a38970cd772e8d3e5d06decf4845f7e29ff-image.png" align="center" width="80% "  alt="Segment types screen with List and Dynamic options, the Dynamic segment's Create button highlighted" />

3. Fill in general properties:

* Name (required) — displayed in the general segment list.
* Purpose (optional) — specify how the campaigns will be used. For example, for triggered emails, regular promo campaigns, etc.
* [Tags](https://docs.esputnik.com/docs/adding-tags) (optional) — select from the list or add a new one for quick filtering and segment search.

4. Click **Next**.

<Image src="https://files.readme.io/f0fb9a1d30ae94ba69525984292f4459442b911654654821f40a83a009505ae8-image.png" align="center" width="80% "  alt="Add dynamic segment General Properties form with Name and Purpose fields and the Next button highlighted" />

5. Add condition.

For example, you need to select all subscribers who have read emails this month. 

6. Go to the **Channels tab → Contact activity by Email → Last opened → During → This month**.

The **Last opened** condition holds only the most recent open, so it suits the current period but not a past one: a contact who opened messages both in October and in November does not fall into a segment for October.

<Image src="https://files.readme.io/8e06b6b7113746fbb082c4cb644c3224a2d0d7b698c9dcaa97c1dc431fa0d967-image.png" align="center" width="80% "  alt="Condition builder columns showing Contact activity by Email, Last opened, during, and this month selected" />

7. To see what contacts have been added, click on **Preview contacts in the segment**.

<Image src="https://files.readme.io/74bd3e81b1cd9567a9e24f544b7ad30f9d7bba9d92d6ead93f19e8c577596d2f-image.png" align="center" width="80%"  alt="Add dynamic segment Conditions tab with a Last opened during this month condition and the Preview contacts in the segment button highlighted" />

8. To see how many contacts are in the segment, click on **Recalculate contacts**.

<Image src="https://files.readme.io/0cd8b15bc2a77002242ab57b6676938dfdc1e823a7b617f2aefc4bbee7a6c010-image.png" align="center" width="80% "  alt="Add dynamic segment Conditions tab with the Recalculate contacts button highlighted" />

9. If you need to create a custom condition for creating a segment, scroll down the list of conditions and click **Set up segmentation**.

<Image src="https://files.readme.io/9ba19d1a207bb93a99df5c270b9ddfd361de650d079b68a4bcd0f2666127a547-image.png" align="center" width="80%"  alt="Condition builder columns with the Set up segmentation button highlighted at the bottom" />

10. In the window, select the following type of settings:

* Contact field management
* Segmentation by custom events
* Segmentation by events for eCommerce retailers

<Image src="https://files.readme.io/a08c530c4749272509fc1327fc7d4e26d159b92fa6a0959581cb8d6a4ac98a2e-image.png" align="center" width="80%"  alt="Segmentation settings window listing Contact field management, Segmentation by custom events, and Segmentation by events for eCommerce retailers options" />

11. You can copy a card to avoid having to recreate its conditions manually. By default, the copied card is added with an `OR` operator, which you can manually change to `AND`.

<Image src="https://files.readme.io/83f4b458d5a51d73ea0415caefc0b817c41710c32b00889a244c4ad83cc4c08e-image.png" align="center" width="80% "  alt="Segment card with the duplicate icon highlighted, showing a copied card B added below with an OR operator" />

12. When all the necessary conditions are specified, click the **Done** button. The new segment will be available in the general list of groups.

<Image src="https://files.readme.io/1ee8ccc9cbeb5d13625d98710fe47bd0cedd782a98890e82eb41d628bc3c30a4-image.png" align="center" width="80% "  alt="Add dynamic segment Conditions tab with the Done button highlighted" />

### Automatic Dynamic Segment Creation

<Callout icon="📘" theme="info">
  This feature is available for the **Pro** pricing plan with an active <Anchor target="_blank" href="https://esputnik.com/en/segmentation-price">CDP packages</Anchor> subscription.
</Callout>

After you activate the subscription, the system automatically creates 20 preconfigured dynamic segments for recommendation triggers (such as **Abandoned search**, **Wishlist reminder**, **New products**, etc.). You can use these segments immediately in campaigns and workflows.

**Creation details**:

* the system creates the segments once during the first subscription activation for each organization;
* the system generates segment names in the organization’s language set in the account;
* when new recommendation triggers become available, the system automatically creates the corresponding segments.

## Dynamic Segment Conditions

Let's take a closer look at how to create a segment with multiple conditions.

### 1. Card conditions

Contact state is available as a condition on the **Email** field on the **Contact fields** tab, in the **Personal data** group. Besides the text operators, it offers the states blacklisted, not confirmed, reported spam, and unsubscribed — that is how you exclude such contacts from a segment.

You can create an unlimited number of cards, each having unlimited conditions.

#### Conditions inside the cards

When adding conditions to a card, the segment will include only those contacts that match the specified conditions.

For example, you add two conditions:

* Last opened this year;
* Average order check greater than $1,000.

<Image src="https://files.readme.io/89178a223890615de5d8d3c8bd6b9784aced5c25496d241a01cc22b7fe171a03-image.png" align="center" width="80%"  alt="Condition builder showing Orders count selected, greater than operator, and value 1000 entered" />

The segment will include only those contacts who have opened emails over the past year, with an average order value of more than $1,000. The card will look like this:

<Image src="https://files.readme.io/77f6a6f701bbd862502746637ec33718dfe0613dd46c49921d2d9539765ecc52-image.png" align="center" width="80%"  alt="Segment condition card combining Last opened during this year and Orders count greater than 1000 conditions with AND" />

The conditions of the **Orders** group — **Average order value**, **Orders count**, and **Last orders date** — count only the orders that reached the `DELIVERED` status, so such a segment holds fewer contacts than the number of people who have ever ordered. See [Order Transfer Using the Add Orders API Method](https://docs.esputnik.com/docs/add-orders-api-method-for-order-transferring).

To add the contacts that match any condition, choose the corresponding option in the header of the card:

<Image src="https://files.readme.io/b63e4ef083002a1506745112d60a4ff4336b5d57dd19541dd34a671aeb16cbc9-image.png" align="center" width="80%"  alt="Card header dropdown menu with the Contact matches any of the conditions - OR option highlighted" />

For example, you add the following conditions:

* Last clicked week ago;
* Last opened week ago

The segment will include the contacts that either clicked on links in the email or read an email a week ago.

<Image src="https://files.readme.io/591a4715404034b9203a81c9dbff345149b70ebcd7aba0e5424983ed7f11d0cf-image.png" align="center" width="80%"  alt="Segment condition card set to Contact matches any of the conditions - OR, showing Last clicked and Last opened conditions" />

#### Excluding Conditions from a Card

Any of these conditions can be made negative. Click on **≠** to exclude any condition from the card.

<Image src="https://files.readme.io/25705947fba4d5b6ead7a33c5641fd333b64f19f40814827fdcc74d9f5031289-image.png" align="center" width="80%"  alt="Segment condition card with the not-equal icon highlighted next to an excluded Average order value condition" />

For example, you want to add to the card all the contacts that have opened emails over this month, with an average order value less than $1,000. Exclude the last condition, and the segment will include only the contacts that have opened emails during the last month and their average order value is more than $1,000.

#### Excluding the Entire Card

You can exclude the whole card. Such a card will be highlighted red and will have a not prefix in the segment equation.

<Image src="https://files.readme.io/7235e0f15b440eedbaac2a2f4538855a9409cadcdc29ecd603b7f7c4345b3efe-image.png" align="center" width="80%"  alt="Segment equation showing not A, with the excluded card highlighted in red" />

#### Excluding a Condition from the Segment

With many cards, when you need to exclude a particular condition from the entire segment, use the right column. Contacts that match the conditions from the right column will not be included in the segment.

<Image src="https://files.readme.io/28009326d619b60b5491b57ada3fc1faf9371b4f03c9a01ca13b308898657a6e-image.png" align="center" width="80%"  alt="Segment equation showing A minus B, with the Exclude card B highlighted" />

You can exclude several cards with different conditions.

> 📘 Note
>
> For conditions with a **valid/not valid** state (for example, a push token condition), "not valid" covers **all** contacts that don't meet the "valid" criteria — this includes contacts with no token at all **and** contacts whose token exists but is older than the validity window (for example, expired or not refreshed within the last month). If you need to separate "no token" from "expired token," build two condition cards instead of relying on a single "not valid" condition.

A push token doesn't mean the user allowed notifications: the app can register a token even when the user declined the permission. To select the contacts who actually allowed notifications, segment by the `PushNotificationsSubscribed` and `PushNotificationsUnsubscribed` events, which the SDK sends when the permission changes.

### 2. Equation Operators AND/OR

For convenience of operation, you can group conditions in several cards using the following operators:

AND — the segment will include all the contacts that match the conditions of all cards.

OR — the segment will include the contacts that match the conditions of any card.

<Image src="https://files.readme.io/192224a8014e5897935dc6c772a1ac61833e020abe55ea175fd4c7440a7da796-image.png" align="center" width="80%"  alt="Segment equation showing A or B, with the OR/AND operator dropdown between the two cards highlighted" />

### 3. Segment Equation

With many cards, the segment equation is displayed in the following formula: (A or B) – C.

<Image src="https://files.readme.io/23f478b7373338b9e4a69406998c4364ddf0536356363dd0d7cc783cdf5b2f1e-image.png" align="center" width="80%"  alt="Segment equation showing (A or B) minus C above three condition cards labeled A, B, and C" />

* The equation shows in what order the cards are processed.
* Brackets are put automatically to unite the cards based on the processing priorities.
* The letters in the equation match the cards. A cursor on the letter automatically highlights the corresponding card.

<Image src="https://files.readme.io/7a27969-creating-dynamic-segment-19.gif" align="center" width="80% " alt="Segment equation (A or B) - C above Include and Exclude columns showing cards A, B, and C with their conditions" />

* If the card isn’t displayed on the screen, hover over the corresponding letter in the equation to see the conditions.

<Image src="https://files.readme.io/1eedcf5-creating-dynamic-segment-20.gif" align="center" width="80% " alt="Segment equation (A or B or C) - D with the letter B highlighted by the cursor hovering over it" />

By default, the contacts that are processed first are united by AND operator. In the equation, such cards are enclosed in brackets.

<Image src="https://files.readme.io/92702a90fce69fe004734f290947d7fef6a66d7ecd36044ae59e75e5a1ca2d0c-image.png" align="center" width="80%"  alt="Segment equation showing (A and B) or C, with cards A and B grouped by AND and combined with card C using OR" />

For example, the equation “(A and B) or C” will be processed as following:

1. First, the system will find the contacts that match the conditions in A and B cards.
2. Next, it will add the contacts that match the conditions in C card.

The conditions must not form a circle. The **Segment** condition lists the segment you are editing along with the others, so a segment can be pointed at itself — and then it has to know its own contacts before it can calculate them. The contact count and the export end with an error, and a campaign to such a segment does not start. The same happens when a segment uses another segment whose own conditions point back to it. Rebuild such conditions so that no segment depends on its own result.

## Useful Features

For more convenience, all the features are now available right in the segment interface after you’ve created a card:

### 1. Export a Dynamic Segment to the List

You can export all the contact details as a static segment to the existing list. This is relevant for triggers so that a [campaign for a segment](https://docs.esputnik.com/docs/launching-a-regular-workflow-for-a-segment) can be launched instantly.

<Image src="https://files.readme.io/c6890de6272acaf6859206bfe3be9cd874d26d7189434cb0df0068b64abac17f-image.png" align="center" width="80% "  alt="Dynamic segment page with the Export dropdown open showing To the existing lists and To the new list options" />

### 2. Splitting a Segment

This might be useful for A/B testing.

<Image src="https://files.readme.io/57daa3b6aa14c6beee88a5c9689c0ae0b60c8ead367b9a36f0ecb34156a3a54f-image.png" align="center" width="80% "  alt="Dynamic segment page with the Split segment button highlighted" />

You can split a segment only if it includes more than 10 contacts. We recommend conducting split tests with more than 2,000 active contacts to avoid inaccurate results.

### 3. Tutorial

For any information on the segment creation, see **Tutorial** at the top of the page.

Hints are divided into 5 categories:

* Conditions inside cards
* Formula for contacts calculating
* Operator `NOT`
* `AND`, `OR` between cards
* Excluding contacts

<Image src="https://files.readme.io/d25bbecfe1652031034f00af4b811d9c64be8fc6f7a33a349f0e8053892835d9-image.png" align="center" width="80% "  alt="Dynamic segment page with the Tutorial button highlighted" />

### 4. Searching Events and Parameters

The search logic of events and parameters allows you to quickly and easily set the conditions for forming a dynamic segment.

The search works both in the first column (names of event types and contact parameters) and in the second (names of event parameters and additional contact fields).

If both the event and its parameter match the search query, you will see the corresponding events in the first column, and in the second column, not only the parameters that match the search query but also all the parameters of the events from the first column.

<Image src="https://files.readme.io/0bf6984f12a9da8a72f710d48328de51f9af95f8a8d3c389c0abca011b1f5afc-image.png" align="center" width="80% "  alt="Condition builder search results for workout highlighting matching fields in the first column and related parameters in the second column" />

If you need to find all events that contain a certain parameter, enter its name in the search field. The first column will display the corresponding events, and the second column will display a list of event parameters indicating which event contains the parameter from the search query.

<Image src="https://files.readme.io/d6a8e5a867d4b3dd1b16878faef517d65d52b8c53940d9d88970de7a4ed5b858-image.png" align="center" width="80% "  alt="Condition builder search results for appversion showing matching events in the first column and their appVersion parameter highlighted in the second column" />

When you hover over a parameter in the first column, the name of the event type containing this parameter is highlighted.

<Image src="https://files.readme.io/19e94b4e6b163f9e10ec20445b751d162098672d5264226ec586dbfd1a6a1ce0-image.png" align="center" width="80% "  alt="Condition builder with account_created hovered in the first column, highlighting its related entries in the second column" />

Click on a specific event's name to see a list of all parameters. The parameter that matches the search query is highlighted.

<Image src="https://files.readme.io/ab41e1f1d07c262fde0c822a2cd8046846a49ef6433e757111395eb9ccc4a538-image.png" align="center" width="80% "  alt="Condition builder showing all parameters for the account_created event with appVersion highlighted as the search match" />

### Segmenting by Country and Market ID

To use a contact's location or assigned market in a dynamic segment, add a condition and select **Contact parameters → Contact fields → Personal**. The section includes:

* **Country** (`countryCode`): find a country by name, then use **is empty**, **is set**, **equals**, **does not equal**, or **one of**;
* **Market ID** (`marketId`): enter the market identifier and use **is empty**, **is set**, **equals**, **does not equal**, **starts with**, or **one of**.

These conditions let you build localized segments without copying country or market data into an additional field. For example, you can select contacts from several countries for one regional campaign or target users assigned to a particular store or market.

You can use the same fields in a workflow — in the **Branch** and **Check Values** blocks and in other workflow settings where a contact field can be selected.

<br />