# How to Create and Manage Segments in CustomerGlu

### Overview

Segments in CustomerGlu allow you to define target audiences based on user events and attributes. Segments ensure that only relevant users qualify for specific campaigns, making your engagement strategies more effective.

There are two types of segments:

* **Event-Triggered Segments**: Users enter the segment when a specific event occurs, such as `Sign Up` or `Purchase Completed`.
* **Static Segments**: Users are added manually or via CSV import for testing or predefined targeting.

Once a segment is assigned to a campaign, users who qualify will automatically enter the campaign and receive relevant experiences.

***

### Creating a New Segment

#### 1. Navigate to the Segments Section

1. Open the **CustomerGlu Dashboard**.
2. Go to **Segments**.
3. Click **Create Segment**.

#### 2. Name Your Segment

* Enter a **Segment Name** that clearly describes its purpose, e.g., *Activation Experiment - New Users*.

#### 3. Define the Event Trigger

* Select an **Event Trigger** to define when users enter this segment.
* Common event triggers include:
  * `Sign Up`
  * `Purchase Completed`
  * `Reward Granted`
* Events can be sent via **server-side integrations** or through external tools like **RudderStack, Segment, or CustomerGlu’s SDKs**.

**How Event-Triggered Segments Work**

* When a defined event is fired for a user, **they are automatically added to the segment**.
* If the segment is linked to a campaign, the campaign **immediately activates** for that user.
* Example:
  * You create a segment with the event trigger **"Sign Up"**.
  * A new user signs up → They are added to the segment.
  * If this segment is part of a campaign, the campaign starts for them (e.g., they receive a welcome reward or mission).

#### 4. Add Properties & Conditions

* Refine the segment further by adding conditions such as:
  * `Sign Up Date > January 1, 2025`
  * `Channel = Facebook`
  * `Reward Amount > 50`
* **Conditions can use AND/OR logic** to create complex targeting rules.

#### 5. Verify Incoming Events

* To check what events are being received, navigate to:
  * **Developer Console → Data Ingestion**
  * Here, you can see real-time event data to confirm that your event triggers are correct.

#### 6. Save the Segment

* Once the conditions are set, click **Save**.
* The segment will now appear in the **Audience List**, ready to be used in campaigns.

***

### Managing Users in a Segment

#### Viewing Segment Details

* Click on the created segment to:
  * View applied **rules & conditions**.
  * See **total users in the segment**.
  * Check **new users added this week/month**.

#### Adding & Removing Test Users

* Click **“Add User”** and enter a **User ID** to manually add a user.
* This is useful for **testing campaigns before launch**.
* Once testing is complete, you can **remove** the test user.

#### Importing Users via CSV

* Instead of manually adding users, you can **upload a CSV file** containing **user IDs**.
* The system will automatically process and add users to the segment.

***

### Using Segments in a Campaign

#### 1. Assign the Segment to a Campaign

* When creating a new campaign, navigate to the **Audience Section**.
* Select the **Segment** from the list.

#### 2. Editing Segment Filters

* You can edit the **segment conditions** even after assigning it to a campaign.
* This ensures you can fine-tune audience targeting without re-creating segments.

#### 3. Real-Time User Entry

* If the segment is based on an event trigger, users will be **added dynamically** when the event occurs.
* This means the campaign will **immediately activate** for them.


---

# 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://docs.customerglu.com/miscellaneous-topics/how-to-create-and-manage-segments-in-customerglu.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.
