docs
  1. Documentation
  2. The Basics
  3. Customer Segments

Customer Segments

Rule-based segments allow you to define dynamic customer groups based on criteria you configure, and use those groups as conditions in promotions and rules. Unlike static audience lists, segments are evaluated in real time – membership is checked at the moment a promotion is applied or a checkout rule is evaluated, so the result always reflects the customer's current attributes.

Segments are managed through the SCAYLE Panel or the Admin API. You can create, update, and delete segment definitions, assign them as include or exclude conditions on promotions, and retrieve membership data per customer through the Customer Account API.

Key Benefits

Segments scale to large customer bases without requiring precomputed membership lists. Evaluation happens in real-time, so promotions and rules always reflect a customer's current group standing.

You can use segments as both include and exclude conditions on the same promotion, giving you fine-grained control over who sees and can apply a given offer. Guest users and unauthenticated sessions are never matched to a segment, ensuring segment-based promotions are only surfaced to logged-in customers.

Capabilities Overview

The following table summarizes what you can do with customer segments.

CapabilityDetails
Segment managementCreate, update, and delete segments via the SCAYLE Panel or Admin API.
Criteria logicAND and OR conditions across customer groups, custom data, and IDs.
Promotion targetingUse segments as include or exclude conditions on any promotion.
Segment size estimateThe SCAYLE Panel shows an estimated count of matching customers while you define the criteria.

Understanding the Feature

When a promotion with a segment condition is evaluated – for example, during basket validation – SCAYLE checks the customer's current attributes against the segment rule and returns a match or no-match result. This check happens inline, without a separate sync job or precomputed membership table.

The SCAYLE Panel provides a rule builder for non-technical users. As you define criteria, a live estimate of the matching customer population is shown. 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.

For server-side rendered storefronts, promotions with segment conditions are not included in the initial page render, as no customer session is available at that point. These promotions are loaded client-side once the customer's session is established.

Deleting a segment does not automatically remove it from promotions or rules that reference it. You should remove those references before deleting the segment to avoid broken configurations.

Key Notes and Limitations

  • Segment membership is evaluated in real time. Changes to a customer's attributes are reflected at the next evaluation without manual updates.
  • Retrieving all customers assigned to a segment is eventually consistent and may reflect data up to 15 minutes old. This endpoint is suitable for export or admin use cases, not real-time promotion decisions.
  • Guest users and unauthenticated sessions are never matched to any segment.
  • Segment-based promotions are not returned in server-side rendered page loads and require a client-side fetch after the customer session is established.
  • Deleting a segment does not cascade to promotions or rules that reference it.
  • The customer count shown during segment creation in the SCAYLE Panel is an estimate based on a sample and may not reflect recent changes to your customer base.

Applicable Scenarios

The following table shows how different segment configurations affect promotion visibility for guest and logged-in customers.

ScenarioSegment configurationGuest userLogged-in, matchesLogged-in, does not match
Regular promotionNoneVisibleVisibleVisible
VIP-only offerAllowlist: VIP segmentHiddenVisibleHidden
Employee exclusionBlocklist: Staff segmentHiddenHiddenVisible
Tiered VIP, top tier onlyAllowlist: Top VIP, Exclude: Standard VIPHiddenVisibleHidden

Any segment condition, include or exclude, restricts the promotion to logged-in customers. If you exclude a segment, guests will not see the promotion either.

Step-by-Step Guide – Customer Segments

This section outlines the full path – from defining a segment to surfacing the resulting promotion on your storefront.

  1. Define the targeting rule. Decide which customers the segment should match and express the rule against customer attributes (customer.groups, customer.customData.*, customer IDs) with the supported operators (IN, !, ==, !=, >, >=, <, &&, ||, contains). → See Segment Criteria.
  2. Create the segment. In the SCAYLE Panel (CustomersCustomer Segments+ New Segment), set a Segment name and build the rule. → See Setting up a Segment via SCAYLE Panel. Alternatively, manage segments through the Admin API. → See Setting up a Segment via Admin API.
  3. Attach the segment to a promotion. In the promotion's Customer segments section, switch to Selected customer segments and choose a targeting mode: Allowlist (only these segments are eligible) or Blocklist (these segments are excluded). Includes and excludes can be combined, and the promotion type must support segments. → See Using Segments in Promotions.
  4. Optionally use the segment in a rule. Reference it as a condition in the Rule Engine, where the same real-time evaluation applies. → Using Segments in Rules.
  5. Implement it on the storefront. Send the customer's X-Customer-Token header on /v1/promotions and /v1/baskets so only eligible promotions are returned, and handle the two-step load — segment-based promotions are fetched client-side after the session is established, not in the server-side render. → See Storefront Behavior and the Storefront Application guide on promotions and campaigns.

FAQ

Can I use the same segment across multiple promotions and rules?

Yes. A segment is a standalone definition that can be referenced by any number of promotions and rules simultaneously. Updating the segment's criteria automatically affects all promotions and rules that use it.

Can I update a segment's criteria after it has been assigned to a live promotion?

Yes. Changes to the criteria take effect immediately at the next evaluation. There is no need to reassign the segment to promotions or rules – the updated rule is applied automatically from that point forward.

Is there a limit to how many segments I can create?

There is no cap on the number of segments you can create per shop and country. A single customer can also belong to any number of segments simultaneously.

What happens to a promotion if I delete a segment it references?

The segment reference in the promotion becomes invalid but is not automatically removed. You should update or remove the segment condition on the affected promotions before deleting the segment to avoid unintended behavior.

Can a guest user get a segment-based promotion?

No. Segment evaluation requires a logged-in customer context. Guest users and unauthenticated sessions are never matched to any segment, and segment-based promotions are not shown to them.

Can I exclude a group of customers from a promotion using segments?

Yes. When configuring a promotion, set the customer segment targeting mode to Blocklist and select the segments to exclude. Customers who match that segment will not see or be able to apply the promotion, even if they would otherwise be eligible.

Why are segment-based promotions not showing on the initial page load?

Promotions with segment conditions require a customer session to evaluate membership. For server-side rendered pages, no session is available during the initial render, so segment-based promotions are intentionally excluded. They are loaded client-side once the session is established.

How quickly does a change to a customer's attributes affect their segment membership?

Segment membership is evaluated in real time at the moment of the check. If a customer's attributes change – for example, they are added to a new customer group – that change is reflected immediately at the next evaluation, with no delay or manual refresh required.

The estimated customer count in the SCAYLE Panel does not match what I expect. Why?

The count shown while building a segment rule is an approximation based on a statistical sample of your customer base, not a full evaluation. The actual number of matching customers may differ, particularly for smaller or more narrowly defined segments.