Create Customer Segments
Why segmentation matters
Section titled “Why segmentation matters”Treating every customer the same wastes both your marketing budget and your customers’ attention. A first-time visitor needs different messaging than a loyal repeat buyer. A customer who abandoned their cart yesterday needs a different nudge than someone who has not visited in three months.
Segmentation lets you group customers by shared behaviors, attributes, or lifecycle stage — and then deliver tailored experiences to each group. In ODP, segments update in real time as new events arrive, so customers move in and out of segments automatically based on their actions.
What you will do
Section titled “What you will do”- Understand the three rule types (behavioral, attribute, temporal)
- Create a segment using the ODP audience builder
- Combine rules with AND/OR/NOT logic
- Estimate segment size before activation
- Activate the segment in downstream channels
Understand rule types
Section titled “Understand rule types”Every segment is a set of rules applied to customer profiles. ODP supports three rule types that can be combined freely.
Behavioral rules
Section titled “Behavioral rules”Behavioral rules filter customers by what they did (or did not do). They reference events tracked by your JavaScript SDK or server-side API.
| Example rule | What it matches |
|---|---|
| Viewed product page in last 7 days | Active shoppers |
| Completed purchase with total > $200 | High-value buyers |
| Did NOT open email in last 30 days | Disengaged subscribers |
| Submitted support ticket in last 14 days | Customers needing help |
| Viewed pricing page 3+ times | High-intent prospects |
Attribute rules
Section titled “Attribute rules”Attribute rules filter by profile properties — demographics, account details, or custom fields synced from your systems.
| Example rule | What it matches |
|---|---|
| Country is “United States” | US-based customers |
| Plan is “enterprise” | Enterprise accounts |
| Lifetime value > $1,000 | High-value customers |
| Account created before 2025-01-01 | Long-term customers |
| Custom property “industry” is “Healthcare” | Healthcare vertical |
Temporal rules
Section titled “Temporal rules”Temporal rules add time constraints to behavioral or attribute rules. They control recency and frequency.
| Example rule | What it matches |
|---|---|
| Last purchase was more than 30 days ago | Lapsed buyers |
| First visit was within last 7 days | New visitors |
| Made 5+ purchases in last 90 days | Frequent buyers |
| Last email open was more than 60 days ago | Cold subscribers |
Create a segment in the audience builder
Section titled “Create a segment in the audience builder”Step 1: Open the audience builder
Section titled “Step 1: Open the audience builder”Navigate to Audiences > Segments in the ODP dashboard and click Create Segment.
Step 2: Name your segment
Section titled “Step 2: Name your segment”Choose a descriptive name that reflects the audience and its purpose. Good names make it easy for your team to understand what a segment contains without opening it.
| Good name | Poor name |
|---|---|
| High-value customers - 90 day active | Segment 1 |
| Cart abandoners - last 7 days | Test audience |
| Enterprise trial users - pricing page visitors | Marketing list |
Step 3: Add rules
Section titled “Step 3: Add rules”Click Add Rule and select the rule type. The builder shows available fields based on your tracked events and profile attributes.
Example: Build a “cart abandoner” segment
- Add a behavioral rule: Event
productwith actionadd_to_cart— in the last7 days - Add a NOT rule: Event
orderwith actionpurchase— in the last7 days - The segment now matches customers who added items to their cart but did not purchase in the past week
Step 4: Combine rules with logic operators
Section titled “Step 4: Combine rules with logic operators”Rules within a segment combine with AND/OR/NOT:
- AND — Customer must match all rules (narrower audience)
- OR — Customer must match any rule (broader audience)
- NOT — Customer must not match the rule (exclusion)
Example: Build a “re-engagement” segment
(Last purchase was more than 30 days ago)AND (Lifetime value > $100)AND NOT (Unsubscribed from email)This targets valuable customers who have gone quiet but are still reachable by email.
Step 5: Estimate segment size
Section titled “Step 5: Estimate segment size”Before activating, click Estimate Size to see how many customers match your rules. This helps you:
- Validate that the rules are not too broad (matching everyone) or too narrow (matching nobody)
- Forecast campaign costs if the segment drives paid media
- Identify rule errors (an unexpectedly small segment may have conflicting rules)
Step 6: Save the segment
Section titled “Step 6: Save the segment”Click Save. The segment begins evaluating against all customer profiles. Depending on your data volume, initial population takes seconds to a few minutes.
Create segments via API
Section titled “Create segments via API”For programmatic segment management, use the ODP Segments API:
const fetch = require('node-fetch');
async function createSegment(segment) {
const response = await fetch(
'https://api.zaius.com/v3/segments',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': process.env.ODP_PRIVATE_API_KEY
},
body: JSON.stringify(segment)
}
);
return response.json();
}
// Create a high-value active customer segment
const result = await createSegment({
name: 'High-value active customers',
description: 'Customers with LTV > $500 active in last 30 days',
rules: {
match: 'all',
conditions: [
{
field: 'lifetime_value',
operator: 'greater_than',
value: 500
},
{
field: 'last_activity',
operator: 'within',
value: '30d'
}
]
}
});
console.log('Segment created:', result.id); import requests
import os
def create_segment(segment: dict) -> dict:
response = requests.post(
'https://api.zaius.com/v3/segments',
headers={
'Content-Type': 'application/json',
'x-api-key': os.environ['ODP_PRIVATE_API_KEY']
},
json=segment
)
response.raise_for_status()
return response.json()
# Create a high-value active customer segment
result = create_segment({
'name': 'High-value active customers',
'description': 'Customers with LTV > $500 active in last 30 days',
'rules': {
'match': 'all',
'conditions': [
{
'field': 'lifetime_value',
'operator': 'greater_than',
'value': 500
},
{
'field': 'last_activity',
'operator': 'within',
'value': '30d'
}
]
}
})
print(f'Segment created: {result["id"]}') curl -X POST https://api.zaius.com/v3/segments \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_PRIVATE_API_KEY' \
-d '{
"name": "High-value active customers",
"description": "Customers with LTV > $500 active in last 30 days",
"rules": {
"match": "all",
"conditions": [
{
"field": "lifetime_value",
"operator": "greater_than",
"value": 500
},
{
"field": "last_activity",
"operator": "within",
"value": "30d"
}
]
}
}' Activate segments
Section titled “Activate segments”A segment is only valuable when it drives action. ODP segments can be activated across multiple channels.
Activate in Optimizely CMS
Section titled “Activate in Optimizely CMS”ODP segments sync to CMS visitor groups automatically when the ODP integration is enabled. Use synced segments to personalize content:
- In CMS, navigate to Visitor Groups
- ODP segments appear as available criteria
- Create a visitor group that references the ODP segment
- Use the visitor group to personalize content blocks, pages, or layouts
Activate in Experimentation
Section titled “Activate in Experimentation”Target experiments to specific ODP segments:
- In Experimentation, create or edit an experiment
- Under Audiences, select ODP Segment as the audience type
- Choose your segment from the list
- Only customers in the segment will be bucketed into the experiment
Activate in email campaigns
Section titled “Activate in email campaigns”ODP segments can trigger or target email campaigns:
- Segment entry trigger — Send an email when a customer enters a segment (e.g., “welcome” email when joining “new subscriber” segment)
- Segment exit trigger — Send an email when a customer leaves a segment (e.g., “we miss you” email when leaving “active customer” segment)
- Campaign targeting — Send a campaign only to customers currently in a segment
Activate in advertising
Section titled “Activate in advertising”Sync segments to advertising platforms for targeted campaigns:
- Google Ads — Customer Match audience sync
- Facebook/Meta — Custom Audience sync
- LinkedIn — Matched Audiences sync
Audience sync runs on a schedule (typically every few hours). Customers entering or exiting the segment are added to or removed from the ad platform audience automatically.
Troubleshooting
Section titled “Troubleshooting”| Issue | Cause | Fix |
|---|---|---|
| Segment shows 0 customers | Rules too restrictive or event data not yet flowing | Check each rule individually; verify events appear in the Event Debugger |
| Segment matches all customers | Rules too broad or OR logic too loose | Tighten rules or switch OR to AND for required conditions |
| Customer not in expected segment | Missing events or unresolved identity | Check the customer’s profile Activity tab for expected events |
| Segment not appearing in CMS visitor groups | ODP-CMS integration not enabled | Verify integration setup in ODP Settings > Integrations |
| Segment not available in Experimentation | Sync delay or integration not configured | Check ODP integration status in Experimentation settings; allow 5-10 minutes for sync |
| Advertising audience size much smaller than ODP segment | Platform match rates vary | Ad platforms match on email/phone; customers without these identifiers will not match |