# Tags & Segments

> Learn how to organize contacts with tags and create static and dynamic segments to target the right audience in your WhatsApp campaigns.

Source: https://edesy.in/docs/waflow/contacts/tags-segments

Tags and segments are powerful tools for organizing your contacts and targeting specific audiences in your campaigns. This guide covers how to create, manage, and effectively use both features.

## Understanding Tags vs Segments

Both tags and segments help organize contacts, but they work differently:

| Feature | Tags | Segments |
|---------|------|----------|
| **Purpose** | Label individual contacts | Group contacts by criteria |
| **Assignment** | Manual (or via import/API) | Automatic (dynamic) or manual (static) |
| **Multiple** | Contacts can have many tags | Contacts can be in many segments |
| **Updates** | Manual changes only | Dynamic segments update automatically |
| **Best for** | Quick categorization | Targeted campaigns |

Think of tags as labels you stick on contacts, and segments as filtered views of your contact database.

## Tags

### What Are Tags?

Tags are simple labels you apply to contacts. They help you:

- Categorize contacts quickly
- Filter your contact list
- Target specific groups in campaigns
- Track contact attributes over time

Example tags: `vip`, `newsletter`, `black-friday-2024`, `churned`, `website-lead`

### Creating Tags

Tags are created automatically when you first use them, but you can also create them in advance:

1. Go to **Contacts** > **Tags**
2. Click **Create Tag**
3. Enter the tag name
4. Optionally add a description and color
5. Click **Save**

#### Tag Naming Best Practices

| Good | Avoid |
|------|-------|
| `vip-customer` | `VIP Customer!!!` |
| `newsletter-subscriber` | `NL Sub` |
| `q4-2024-promo` | `promotion` |
| `lead-source-facebook` | `FB` |

Recommendations:

- Use lowercase letters
- Separate words with hyphens or underscores
- Be specific (include dates, sources, etc.)
- Keep names consistent across your team

### Applying Tags to Contacts

#### Single Contact

1. Go to the contact's profile
2. Click the **Tags** section
3. Type to search for existing tags or create new ones
4. Click a tag to apply it
5. Click the X on a tag to remove it

#### Bulk Tagging

Apply tags to multiple contacts at once:

1. Go to **Contacts**
2. Select contacts using checkboxes
3. Click **Add Tags** in the bulk actions bar
4. Select tags to apply
5. Click **Apply**

#### During Import

Apply tags during CSV import:

1. Map a CSV column to "Import as Tag"
2. Or add tags to all imported contacts in settings

See [Import Contacts](https://edesy.in/docs/waflow/contacts/import-contacts) for details.

#### Via API

```bash
curl -X POST https://api.waflow.com/v1/contacts/+14155551234/tags \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tags": ["vip", "newsletter"]}'
```

### Managing Tags

#### View All Tags

Go to **Contacts** > **Tags** to see:

- All tags in your workspace
- Number of contacts with each tag
- Tag descriptions and colors

#### Edit a Tag

1. Go to **Contacts** > **Tags**
2. Click on a tag
3. Edit name, description, or color
4. Click **Save**

> **Note:** Editing a tag name updates it for all contacts with that tag.

#### Delete a Tag

1. Go to **Contacts** > **Tags**
2. Click the delete icon next to the tag
3. Confirm deletion

Deleting a tag removes it from all contacts. Contact data is not affected.

#### Merge Tags

If you have duplicate or similar tags:

1. Go to **Contacts** > **Tags**
2. Select tags to merge
3. Click **Merge**
4. Choose the target tag (all others merge into this)
5. Confirm

All contacts with merged tags will have the target tag.

### Filtering by Tags

Use tags to filter your contact list:

1. Go to **Contacts**
2. Click the **Tags** filter dropdown
3. Select one or more tags
4. Choose filter logic:
   - **Any**: Contacts with any selected tag
   - **All**: Contacts with all selected tags

#### Tag Combinations

Create complex filters with tag logic:

| Filter | Meaning |
|--------|---------|
| `vip` | All VIP contacts |
| `vip` AND `newsletter` | VIPs who are also newsletter subscribers |
| `vip` OR `high-value` | Contacts with either tag |
| `customer` NOT `churned` | Customers who haven't churned |

### Using Tags in Campaigns

Target campaigns by tags:

1. Create a new campaign
2. In recipient selection, choose **Filter by Tags**
3. Select tags and logic
4. Preview the audience size
5. Continue with campaign setup

## Segments

### What Are Segments?

Segments are groups of contacts defined by criteria. Unlike tags, segments can:

- Update automatically based on rules (dynamic segments)
- Be based on multiple conditions
- Combine tags, fields, and engagement data

### Types of Segments

#### Static Segments

Manually curated lists of contacts:

- You add and remove contacts explicitly
- Membership doesn't change automatically
- Useful for hand-picked audiences

**Example use cases:**
- VIP list reviewed quarterly
- Event attendee list
- Custom exclusion list

#### Dynamic Segments

Rule-based groups that update automatically:

- Define criteria, and contacts matching those criteria are included
- Membership updates when contact data changes
- Useful for behavior-based targeting

**Example use cases:**
- "Contacts who purchased in last 30 days"
- "Subscribers who haven't opened last 5 campaigns"
- "High-value customers with email addresses"

### Creating a Static Segment

1. Go to **Contacts** > **Segments**
2. Click **Create Segment**
3. Choose **Static Segment**
4. Enter a name and description
5. Click **Create**

To add contacts:

1. Go to **Contacts**
2. Select contacts using checkboxes
3. Click **Add to Segment**
4. Select your static segment
5. Click **Add**

Or from the segment view:

1. Open the segment
2. Click **Add Contacts**
3. Search and select contacts
4. Click **Add**

### Creating a Dynamic Segment

1. Go to **Contacts** > **Segments**
2. Click **Create Segment**
3. Choose **Dynamic Segment**
4. Enter a name and description
5. Define your rules

#### Building Segment Rules

Dynamic segments use a rule builder:

```
┌─────────────────────────────────────────────────────────────────┐
│ Segment Rules                                                    │
├─────────────────────────────────────────────────────────────────┤
│ Include contacts where [ALL ▼] of the following are true:      │
│                                                                 │
│ [Tag ▼] [contains ▼] [vip ▼]                        [×]        │
│                                                                 │
│ [AND ▼]                                                         │
│                                                                 │
│ [Last Message ▼] [is within ▼] [30 days ▼]         [×]        │
│                                                                 │
│ [+ Add Condition]                                               │
├─────────────────────────────────────────────────────────────────┤
│ Preview: 1,234 contacts match these rules                       │
└─────────────────────────────────────────────────────────────────┘
```

#### Available Rule Conditions

**Contact Fields:**

| Condition | Operators | Example |
|-----------|-----------|---------|
| First Name | is, contains, starts with | First Name contains "John" |
| Last Name | is, contains, starts with | Last Name is "Smith" |
| Email | is, contains, is empty, is not empty | Email is not empty |
| Company | is, contains | Company contains "Tech" |
| Custom fields | varies by field type | purchase_date is after 2024-01-01 |

**Tags:**

| Condition | Operators | Example |
|-----------|-----------|---------|
| Tag | contains, does not contain | Tag contains "vip" |
| Tag count | equals, greater than, less than | Tag count greater than 0 |

**Engagement:**

| Condition | Operators | Example |
|-----------|-----------|---------|
| Last Message | is within, is before, is after | Last message within 30 days |
| Last Reply | is within, is before, is after | Last reply within 7 days |
| Messages Sent | equals, greater than, less than | Messages sent greater than 5 |
| Has Replied | yes, no | Has replied = yes |

**Dates:**

| Condition | Operators | Example |
|-----------|-----------|---------|
| Created | is within, is before, is after | Created within 90 days |
| Updated | is within, is before, is after | Updated within 7 days |

#### Rule Logic

Combine conditions with:

- **ALL** (AND): Contact must match every condition
- **ANY** (OR): Contact must match at least one condition

For complex logic, create multiple rule groups:

```
( Tag contains "vip" AND Email is not empty )
OR
( Tag contains "high-value" AND Last Reply within 30 days )
```

### Example Dynamic Segments

#### Engaged VIP Customers

Contacts who are VIPs and have interacted recently:

```
ALL of:
- Tag contains "vip"
- Last Reply within 30 days
```

#### Dormant Subscribers

Newsletter subscribers who haven't engaged:

```
ALL of:
- Tag contains "newsletter"
- Last Reply is before 90 days ago
```

#### New High-Value Leads

Recent leads with high purchase potential:

```
ALL of:
- Created within 14 days
- Custom field "lead_score" greater than 80
- Email is not empty
```

#### Re-engagement Candidates

Customers who might be slipping away:

```
ALL of:
- Tag contains "customer"
- Tag does not contain "churned"
- Last Message is before 60 days ago
```

### Managing Segments

#### View Segment Contacts

1. Go to **Contacts** > **Segments**
2. Click on a segment
3. See all contacts in the segment
4. Apply additional filters if needed

#### Edit Segment

1. Go to **Contacts** > **Segments**
2. Click the edit icon on a segment
3. Modify name, description, or rules
4. Save changes

For dynamic segments, membership updates immediately based on new rules.

#### Delete Segment

1. Go to **Contacts** > **Segments**
2. Click the delete icon
3. Confirm deletion

Deleting a segment does not delete the contacts in it.

### Using Segments in Campaigns

Target campaigns to segments:

1. Create a new campaign
2. In recipient selection, choose **Select Segment**
3. Choose one or more segments
4. For multiple segments, choose logic:
   - **Union**: Contacts in any selected segment
   - **Intersection**: Contacts in all selected segments
5. Preview audience size
6. Continue with campaign setup

### Segment Limits

| Plan | Total Segments | Dynamic Segment Complexity |
|------|----------------|---------------------------|
| Starter | 10 | Up to 3 conditions |
| Professional | 50 | Up to 10 conditions |
| Business | 200 | Up to 25 conditions |
| Enterprise | Unlimited | Unlimited |

## Best Practices

### Tag Strategy

1. **Create a tag taxonomy**: Define categories before you start
   - Source tags: `source-facebook`, `source-website`, `source-referral`
   - Status tags: `lead`, `customer`, `churned`
   - Interest tags: `interested-product-a`, `interested-product-b`

2. **Be consistent**: Use the same format across all tags

3. **Review regularly**: Audit tags quarterly, merge or delete unused ones

4. **Document your tags**: Maintain a shared reference for your team

### Segment Strategy

1. **Start simple**: Begin with basic segments, add complexity as needed

2. **Name clearly**: Include the purpose in the name
   - Good: "VIP Customers - Active Last 30 Days"
   - Bad: "Segment 1"

3. **Use dynamic segments** for behavior-based groups

4. **Use static segments** for hand-curated lists

5. **Combine with tags**: Use tags for labeling, segments for targeting

### Campaign Targeting

| Audience Type | Recommended Approach |
|---------------|----------------------|
| All subscribers | Tag: "newsletter" |
| VIP customers | Dynamic segment with VIP tag + engagement |
| Event attendees | Static segment with manual list |
| Re-engagement | Dynamic segment with dormancy rules |
| A/B test groups | Static segments with random selection |

## Troubleshooting

### Dynamic Segment Empty

- Check that rules are correctly configured
- Verify condition values (e.g., tag exists, date format correct)
- Try relaxing conditions one at a time

### Tag Not Appearing

- Tags are created on first use
- Check for typos in tag name
- Verify you're in the correct workspace

### Segment Count Seems Wrong

- Dynamic segments update periodically (not real-time)
- Check the "Last Updated" timestamp
- Click "Refresh" to force an update

## Next Steps

Now that you understand tags and segments:

- [Set up custom fields](https://edesy.in/docs/waflow/contacts/custom-fields) for more data points
- [Create targeted campaigns](https://edesy.in/docs/waflow/campaigns/create-campaign)
- [Build automated sequences](https://edesy.in/docs/waflow/automations) based on segments
