docs
  1. The Basics
  2. Customer Segments
  3. Setting Up A Customer Segment

Setting Up a Customer Segment

A segment is a customer group defined by a rule expression. Once created, you can assign it as a condition on any promotion or rule to control who it applies to.

A segment belongs to one shop and one country. To target the same audience in several markets, create the segment in each.

For example: target customers who belong to the "GOLD" group and above the age of 38.

Segment Criteria

Segment criteria are written as rule expressions that evaluate against customer attributes. You can reference customer groups, customData fields, and customer IDs. customData fields are tenant-defined — check your shop's configuration for what is available. Combine or negate conditions using the operators below

OperatorDescriptionExample
INAttribute exists in a list"GOLD" IN customer.groups
!Negation!("STAFF" IN customer.groups)
==Equalscustomer.customData.country == "DE"
!=Not equalcustomer.customData.tier != "BASIC"
>Greater thancustomer.customData.ltv > 1000
>=Greater than or equalcustomer.customData.orderCount >= 5
<Less thancustomer.customData.age < 30
<=Less than or equalcustomer.customData.age <= 30
&&AND – both conditions must be true"GOLD" IN customer.groups && customer.customData.ltv > 500
||OR – either condition must be true"GOLD" IN customer.groups || "SILVER" IN customer.groups
containscontainscustomer.groups contains "VIP"

Examples:

Target VIP customers in Germany with a high lifetime value:

Target any premium tier, excluding staff accounts:

Target loyal customers who have not yet reached VIP status:

Target customers from a specific market who registered recently:

Setting Up a Segment via the SCAYLE Panel

In the SCAYLE Panel, go to Customers ➜ Customer Segments. Here you can view all existing segments and create new ones.

Customer Segments overview with the + New Segment button

Customer segment list

Create a New Segment

  • Select + New Segment (top right). If no segments exist yet, you can also select Create a Customer Segment.
  • In the Segment name field, enter a unique name for the segment. This label is shown across the SCAYLE Panel wherever the segment is referenced.
  • In the Reference key field, enter a stable identifier for use in API integrations.
  • The Segment is active toggle is on by default. Turn it off to save the segment as a draft without making it available for use in promotions.
  • Under Segment definition, choose how to build your rule:
    • Visual (default) – build conditions using attribute, operator, and value dropdowns.
    • Advanced – write the rule directly as a CEL (Common Expression Language) expression.

A segment is defined once for the company and it is available in every shop and country that company has. The country can be defined inside the segment's own rules. If you want German customers only, that goes in the rules. And one segment can cover several markets at once, for example customers registered in Germany or Austria, so recreating it per market is not needed.

With the visual builder you have two options to define the audience: an AI prompt or manually selecting the conditions.

New Customer Segment builder

New Customer Segment builder

Build Conditions Manually

  • Choose from the available customer attributes:
AttributeDescription
Shop CountriesThe country associated with the customer's shop account
Birth DateThe customer's date of birth
Registration DateThe date the customer created their account
Customer GroupsThe groups the customer belongs to
Guest CustomerWhether the customer checked out as a guest
IDP RegisteredWhether the customer is registered via an external Identity Provider (IDP)
Last Login DateThe most recent date the customer logged into their account
Newsletter SignupWhether the customer is subscribed to the newsletter
  • Then select an operator (e.g., equals) and enter the value (e.g., True or False).
Customer Segment Condition Builder — attribute, operator, and value dropdowns

Build a segment by selecting conditions manually

  • To add more conditions to the same group, select + Add sub-condition. To add an independent group of conditions, select + Add rule group. Use the And / Or toggle at the top right of each group to control how its conditions are combined.
Segment condition group

Add sub-condition or rule group

  • When ready, select Save changes to save the new customer segment.

The customer count displayed next to the Segment definition heading is a live estimate of how many customers currently match your rules. The count is estimated from a statistical sample, so it is an approximation rather than an exact figure, and because membership is evaluated in real time it will also change as customer attributes change.

AI Prompt

  • Type a plain-language description of your audience in the prompt field (for example, "not guests and newsletter subscribers") and submit.
  • The SCAYLE Panel generates the matching conditions and populates them in Visual mode. A confirmation banner shows what was interpreted.
  • You can then review and adjust the conditions as needed.
AI Segment Builder generating conditions from a prompt

Use the AI prompt for defining a customer segment

The Guest Customer attribute matches registered customer records created through guest checkout. It does not make a promotion visible to an anonymous session, which carries no customer token and is therefore never evaluated against any segment.

Edit a Segment

  • Open the segment you want to update.
  • Modify the name, reference key, or criteria as needed.
  • Select Save changes. The updated rule takes effect immediately for all future evaluations.

Delete a Segment

  • Open the segment you want to remove.
  • Select Delete.
  • If any promotions or rules reference this segment, the SCAYLE Panel lists them. Update or remove those references before confirming the deletion.

Deleting a segment does not automatically update promotions or rules that use it.

Setting Up a Segment via the Admin API

Customer segments are managed per shop and country via the Admin API at /shops/{shopKey}/countries/{countryCode}/customer-segments.

You can list segments (with optional filters and pagination), create new ones, fetch a single segment by its guid, update existing segments, or delete them. Each segment has a system guid, a business referenceKey, a human-readable name, a criteriaDsl rule string, and an active flag.

Customer segment endpoints in the Admin API:

MethodPathDescription
GET/shops/{shopKey}/countries/{countryCode}/customer-segmentsList segments (supports pagination, filters[name], filters[active]).
POST/shops/{shopKey}/countries/{countryCode}/customer-segmentsCreate a segment.
GET/shops/{shopKey}/countries/{countryCode}/customer-segments/{segmentGuid}Get a single segment.
PATCH/shops/{shopKey}/countries/{countryCode}/customer-segments/{segmentGuid}Update a segment.
DELETE/shops/{shopKey}/countries/{countryCode}/customer-segments/{segmentGuid}Delete a segment.

All five are scoped to a shop and country. Single-segment operations use the segment's guid as {segmentGuid}.