# Segments

{% hint style="info" %}
A segment is a specific group of users categorized based on their demographic or behavioral characteristics.
{% endhint %}

Segmentation is the key to personalization. By dividing users into segments, businesses can create more targeted and relevant messages that resonate with users' individual needs and preferences.

You can create and manage segments at **Segments**.

## Creating a Segment

1. Name a segment
2. Choose filters and fill in the data
3. Add 'And' or 'Or' clause to combine the filters
4. Save your segment

<figure><img src="https://4151189289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSJ35x4PFzaneH3SrvcBt%2Fuploads%2Fz8pdIodnuBBVe2VpbxIM%2F%EC%84%B8%EA%B7%B8%EB%A8%BC%ED%8A%B8_%EC%83%9D%EC%84%B1.png?alt=media&#x26;token=a71c880e-4843-4ff4-b70d-c030cbd42c6d" alt="FlareLane Segments page showing a list of filters"><figcaption></figcaption></figure>

Use filters, 'And' or 'Or' clauses to create a variety of segments.&#x20;

* **'And' clause:** Devices that meet all filters will be included in the segment
* **'Or' clause:** Devices that meet any of the filters will be included in the segment

Integrating [User ID](https://guide.flarelane.com/data-integration/user-id) and [Tags](https://guide.flarelane.com/data-integration/tags) will help you to create more targeted segments. (See [Developer's Guide](https://guide.flarelane.com/audience/broken-reference) for more details). Especially by integrating Tags, you can create segments such as buyers, non-buyers, users with more than 1 item in the shopping cart and much more.

* **User ID:** Unique identifier you have assigned to your app or website users. This helps to segment the customers into registered users and non-registered users.
* **Tags:** A form of metadata that you can add to your customers, such as name, gender or VIP status.

### Data Types

FlareLane allows booleans (true/false), numbers and strings (alpha-numeric characters). Numbers must follow the Unix timestamp millisecond format (See [Developer's Guide](https://guide.flarelane.com/audience/broken-reference) for more details).

<table><thead><tr><th width="334">Operators</th><th>Available Data Type</th></tr></thead><tbody><tr><td><strong>=</strong></td><td>Booleans, Numbers, Strings</td></tr><tr><td><strong>≠</strong></td><td>Booleans, Numbers, Strings</td></tr><tr><td><strong>≥</strong></td><td>Numbers</td></tr><tr><td><strong>≤</strong></td><td>Numbers</td></tr><tr><td><strong>&#x3C;</strong></td><td>Numbers</td></tr><tr><td><strong>></strong></td><td>Numbers</td></tr><tr><td><strong>exists</strong></td><td>Booleans, Numbers, Strings</td></tr><tr><td><strong>does not exist</strong></td><td>Booleans, Numbers, Strings</td></tr><tr><td><strong>within last ~hours</strong></td><td>Numbers</td></tr><tr><td><strong>more than ~hours ago</strong></td><td>Numbers</td></tr><tr><td><strong>time elapsed greater than</strong></td><td>Numbers</td></tr><tr><td><strong>time elapsed less than</strong></td><td>Numbers</td></tr></tbody></table>

* **Time elapsed greater than**

  * Expression used for an event that has occurred in the past
  * ex) `cart_timestamp`| `time elapsed greater than` | `3 hours`&#x20;

  &#x20;      A push notification will be sent to devices that have added a product to their shopping cart 3 hours ago or more from the current point in time
* **Time elapsed less than**

  * Expression used for an event that will occur in the future
  * ex) `Subscription expiration time` | `time elapsed less than` | `168 hours`

  &#x20;      A push notification will be sent to devices whose subscription will expire within the next 168 hours from the current point in time

## Managing Segments

You can view the number and the complete list of devices associated with each segment by clicking **\[···]** > **Devices**. If you want to remove a segment, click **\[···]** > **Delete**.

Segments update in real-time as data changes.&#x20;

<figure><img src="https://4151189289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSJ35x4PFzaneH3SrvcBt%2Fuploads%2F3pxLoZqNXR10sDkgLmpU%2F%EC%84%B8%EA%B7%B8%EB%A8%BC%ED%8A%B8_%EC%84%B8%EB%B6%80%EB%A9%94%EB%89%B4.png?alt=media&#x26;token=b2760fe3-9dc8-4345-bcc7-3b67fa58491f" alt="FlareLane Segments page showing how to view device list and edit or delete a segment"><figcaption></figcaption></figure>

## Filter Types

<table><thead><tr><th width="211">Filter Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>App Version</strong></td><td>Current App version</td></tr><tr><td><strong>Country</strong></td><td>Country code</td></tr><tr><td><strong>Last Accessed</strong></td><td>The time the device last accessed the app or website</td></tr><tr><td><strong>OS Version</strong></td><td>Current device or browser version</td></tr><tr><td><strong>Platform</strong></td><td>The device model name and the OS version</td></tr><tr><td><strong>Push Opt-in</strong></td><td>The time the device initially subscribed to push notifications and is successfully added to the project</td></tr><tr><td><strong>SDK Version</strong></td><td>Current SDK version</td></tr><tr><td><strong>Tag</strong></td><td>A form of metadata that you can add to your customers, such as name, gender or VIP status</td></tr><tr><td><strong>Test Device</strong></td><td>Devices categorized as a test device</td></tr><tr><td><strong>User ID</strong></td><td>A unique identifier you have assigned to your app or website users</td></tr></tbody></table>
