Build a real-time segment¶
A real-time segment is an always-on audience. Instead of a query that runs and produces a list, a real-time segment is a set of conditions that Amperity evaluates every time a customer’s profile changes: a customer joins the segment the moment their profile meets the conditions, and leaves it the moment it no longer does. Use a real-time segment as the entry condition, an exclusion, or an exit condition for a real-time journey, or to split travelers inside one.
Real-time segments are on the Real-time tab of the Segments page, next to database segments on the Database tab. The two are different objects: a database segment queries your customer 360 database, and a real-time segment evaluates a profile collection. For how real-time segments are maintained, see Segments in the real-time reference.
How real-time segments work¶
Every real-time segment belongs to one profile, which is a profile collection: the set of real-time customer profiles your operators configure. A segment’s conditions test that profile’s attributes, and there are three kinds:
Database attributes come from your customer 360 database, such as value tier, loyalty status, lifetime orders, or a predicted score. They update after each database run.
Event attributes summarize the customer’s recent behavior from events, such as the current cart, the most recent product viewed, or the number of product views in the last seven days. They update as events arrive.
Computed attributes combine other attributes with an expression, such as “has items in their cart and has not changed it in 30 minutes.” A computed attribute that tests how much time has passed updates when that time passes, even if the customer does nothing.
A segment re-evaluates whenever any of these change, so membership tracks the customer’s behavior as it happens. Which attributes are available depends on how your profile is configured. If the segment you need requires an attribute that doesn’t exist, ask the person who manages your profile collections to add it. For the attributes behind common programs, see Abandoned cart and browse recovery.
Define a real-time segment¶
A real-time segment has:
Name. How the segment appears in journeys and in the segment list.
Labels. Optional, for finding and grouping segments.
Profile. The profile collection whose customers the segment evaluates. Every segment and journey that work together must use the same profile.
Conditions. At least one condition, in the Where editor:
Visual mode builds each condition from a category, an attribute, an operator, and a value, such as “Value tier is equal to Gold.” Every condition must be true for a customer to join; the conditions are combined with AND.
Code mode takes an expression in Amperity’s expression language. Use Code mode for conditions that combine with OR, or that Visual mode can’t express. An expression written in Code mode that Visual mode can’t display stays in Code mode.
When you create the segment, it starts filling right away. Its Status shows Queued, then Updating while Amperity evaluates the profile’s existing customers, then Ready. The status can also show Paused. There is no separate step to turn it on.
Examples¶
These examples use attribute names your profile may not have. Use the names on your own profile.
Cart abandoners
Customers whose cart has items and has not changed in 30 minutes, from a computed attribute:
cart_abandoned = true
High-value repeat browsers
Customers in your top value tiers who viewed a category four or more times this week and have not ordered, combining a database attribute with event attributes:
value_tier in ('Platinum', 'Gold') and category_views_7d >= 4 and orders_7d = 0
Not reachable by email
Customers to keep out of an email journey, for use as an exclusion:
email_opt_in = false or email is null
Review a real-time segment¶
A real-time segment’s page has three tabs:
Overview shows how many customers are in the segment, the percent of all profiles that is, and how membership has changed over the last three hours, seven days, or 90 days.
Used in journeys lists the journeys that use the segment. Check it before you change a segment’s conditions, because a change affects every journey that uses it.
Customers lists the profiles in the segment and their attributes. Viewing it requires permission to view personal data.
If a segment’s members aren’t what you expect, see Troubleshoot real-time.
Developers can read a segment’s members, or the segments a customer belongs to, through the Real-time API.