Segments
Read, size and build customer segments from your AI assistant, starting from a goal, a template or your own rule.
A segment is a saved group of customers defined by a rule, such as "ordered twice but not in the last 60 days". VYG keeps each segment up to date: segments you create refresh every 15 minutes, and the built-in lifecycle segments refresh hourly or every 4 hours.
Your assistant works with segments through two tools:
segmentsreads. Pick a view:list,get,audience,members,history,estimateorcatalog.manage_segmentchanges. Pick an op:create,update,duplicate,archiveorexport. The assistant confirms every change with you first.
Segments need the Customers (CDP) feature for your brand, the same rule as the Segments pages in vyg.ai.
Rules read in plain words the same way as in the Segments list in vyg.ai, for example "Placed an order" or "Spent more than $500 in total". Long rules spell out the first two conditions and count the rest.
Seeing your segments
- "List my segments with how many people are in each and whether any need attention."
- "What does the Lapsed buyers segment include?"
- "How has the size of my VIP segment changed this month?"
The list view returns each segment's size, a 30-day size trend, a health note when something needs attention (for example "No one matches yet") and its rule in plain words.
Who is in a segment
- "Show me the first 25 people in Big spenders, with their orders and total spend."
- "Who joined or left the At Risk segment this week?"
Email addresses and phone numbers come back masked (j***@example.com, ***1234). Ask for the full contact details only when you need them; the assistant passes show_contact_details: true.
Building a segment
Start from what you want to achieve. The catalog view lists what a segment can start from:
| Catalog | What it holds |
|---|---|
goals | The eight goals of the New segment screen, with defaults sized to your store (your usual reorder gap and spend levels). |
templates | Ready-made recipes and the lifecycle stages (Visitors, Customers, Repeat Customers, ...). |
fields | Every customer field and data source a rule can use. |
events | The store, website and app events a rule can use, with how often each happened recently. |
For placed orders and left checkouts, the event counts are the orders and abandoned checkouts of known customers in the last 30 days, which is what a rule on them matches. A checkout with no known customer is not counted, because it can't join a segment.
Then size it before saving:
- "How many customers would a win-back segment for people who haven't ordered in 90 days include?"
- "Compare the size of these three versions of the rule." (up to 10 drafts in one count)
- "If I change VIP to require $500 instead of $250, how many people would leave?"
- "How many of them can I email or text, and what have they spent in total?" (
include: ["reach", "value"], for one rule)
For a saved segment, the audience view with include: "value" adds the members' total sales, orders, average order value and lifetime value, as the segment page shows.
And save it:
- "Create the win-back goal segment using my usual reorder gap, and leave out anyone refunded recently."
- "Create a segment from the Repeat buyers template."
- "Duplicate the built-in Churned segment so I can edit it."
Goal segments are built the same way as the goal cards on the New segment screen, so a segment made by your assistant opens in the builder as the same sentences.
Joined through a sign-up form
To find people who subscribed through a specific sign-up form, use the consent_events source with the signup_form field (the form's id) and the status opted_in or optin_confirmed:
{
"source": "consent_events",
"rule": {
"op": "count-over-window",
"where": [
{ "field": "status", "op": "in", "value": ["opted_in", "optin_confirmed"] },
{ "field": "signup_form", "op": "equals", "value": "<sign-up form id>" }
],
"window": { "days": 90 },
"times": { "op": "greaterThanOrEqualTo", "n": 1 }
}
}See Segment rules for the full rule grammar.
Changing and archiving
updatesaves a new version of a segment's rule. Earlier versions are kept.archivestops a segment updating and removes it from the active list. Its history is kept, and its name can be reused.- Built-in segments cannot be changed or archived. Duplicate one to customize it.
Members update within 15 minutes of a change.
Downloading the member list
- "Export the VIP segment as a CSV."
export returns the same CSV as Download list in the web app: name, email, phone, orders, total spend, currency, last order and the date each person joined. The file comes back in the answer when the segment has up to 2,000 people and the file is under about 150,000 characters. For a bigger segment, export tells you where to download it instead: in the vyg.ai web app, open Customers, then Segments, find the segment and choose Download list. The export shows full email addresses and phone numbers, as the web download does, so ask for it only when you need the contact details.