Skip to content

Create Customer Segments

⏱ 25 minutes intermediate
📜CoreODP

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.

  1. Understand the three rule types (behavioral, attribute, temporal)
  2. Create a segment using the ODP audience builder
  3. Combine rules with AND/OR/NOT logic
  4. Estimate segment size before activation
  5. Activate the segment in downstream channels

Every segment is a set of rules applied to customer profiles. ODP supports three rule types that can be combined freely.

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 ruleWhat it matches
Viewed product page in last 7 daysActive shoppers
Completed purchase with total > $200High-value buyers
Did NOT open email in last 30 daysDisengaged subscribers
Submitted support ticket in last 14 daysCustomers needing help
Viewed pricing page 3+ timesHigh-intent prospects

Attribute rules filter by profile properties — demographics, account details, or custom fields synced from your systems.

Example ruleWhat it matches
Country is “United States”US-based customers
Plan is “enterprise”Enterprise accounts
Lifetime value > $1,000High-value customers
Account created before 2025-01-01Long-term customers
Custom property “industry” is “Healthcare”Healthcare vertical

Temporal rules add time constraints to behavioral or attribute rules. They control recency and frequency.

Example ruleWhat it matches
Last purchase was more than 30 days agoLapsed buyers
First visit was within last 7 daysNew visitors
Made 5+ purchases in last 90 daysFrequent buyers
Last email open was more than 60 days agoCold subscribers

Navigate to Audiences > Segments in the ODP dashboard and click Create 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 namePoor name
High-value customers - 90 day activeSegment 1
Cart abandoners - last 7 daysTest audience
Enterprise trial users - pricing page visitorsMarketing list

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

  1. Add a behavioral rule: Event product with action add_to_cartin the last 7 days
  2. Add a NOT rule: Event order with action purchasein the last 7 days
  3. 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.

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)

Click Save. The segment begins evaluating against all customer profiles. Depending on your data volume, initial population takes seconds to a few minutes.

For programmatic segment management, use the ODP Segments API:

Create a segment via API
javascript
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);
python
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"]}')
bash
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"
        }
      ]
    }
  }'

A segment is only valuable when it drives action. ODP segments can be activated across multiple channels.

ODP segments sync to CMS visitor groups automatically when the ODP integration is enabled. Use synced segments to personalize content:

  1. In CMS, navigate to Visitor Groups
  2. ODP segments appear as available criteria
  3. Create a visitor group that references the ODP segment
  4. Use the visitor group to personalize content blocks, pages, or layouts

Target experiments to specific ODP segments:

  1. In Experimentation, create or edit an experiment
  2. Under Audiences, select ODP Segment as the audience type
  3. Choose your segment from the list
  4. Only customers in the segment will be bucketed into the experiment

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

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.

IssueCauseFix
Segment shows 0 customersRules too restrictive or event data not yet flowingCheck each rule individually; verify events appear in the Event Debugger
Segment matches all customersRules too broad or OR logic too looseTighten rules or switch OR to AND for required conditions
Customer not in expected segmentMissing events or unresolved identityCheck the customer’s profile Activity tab for expected events
Segment not appearing in CMS visitor groupsODP-CMS integration not enabledVerify integration setup in ODP Settings > Integrations
Segment not available in ExperimentationSync delay or integration not configuredCheck ODP integration status in Experimentation settings; allow 5-10 minutes for sync
Advertising audience size much smaller than ODP segmentPlatform match rates varyAd platforms match on email/phone; customers without these identifiers will not match