Customer segments

Why your Shopify segment query isn’t working

Most segment errors come from a handful of rules in Shopify’s reference. Check these in order, or paste your query into the checker.

Build or convert a segment

Pick filters in plain English and copy a query Shopify accepts, or paste an old query to convert it.

Runs in your browser. Nothing is sent anywhere.

Open the Segment Builder

1. It uses the old = true form

Since October 1, 2026 functions use MATCHES / NOT MATCHES. products_purchased(id: 123) = true becomes products_purchased MATCHES (id = 123).

2. A value has the wrong capitals

Values for fields like email or subscription status come from a fixed list and are case-sensitive.

Doesn’t match
email_subscription_status = 'subscribed'
Works
email_subscription_status = 'SUBSCRIBED'

Customer tags are the exception: Shopify says tags are not case-sensitive.

3. Double quotes or missing quotes

Text values go in single quotes. A single quote inside a value is escaped with a backslash: '\'VIP\''. IDs and numbers take no quotes.

4. Currency symbols or thousand separators

Write amount_spent >= 1000, not $1,000. Use a dot for decimals. number_of_orders takes whole numbers only.

5. More than 10 filters

Shopify’s reference shows a query with 11 clauses as invalid. Split the audience into two segments, or tag the customers and filter on the tag.

6. AND and OR without brackets

Without brackets, AND is applied before OR, so this matches big spenders whether or not they’re subscribed:

Probably not what you meant
amount_spent > 100 OR number_of_orders >= 5 AND email_subscription_status = 'SUBSCRIBED'
Subscribers who spent 100+ or ordered 5+ times
(amount_spent > 100 OR number_of_orders >= 5) AND email_subscription_status = 'SUBSCRIBED'

7. The wrong kind of ID

Use the plain number from the admin URL (for example 1012132033639), not a gid://shopify/Product/... ID.

Sources: shopify.dev: Segment query language reference; Shopify Help Center: Components of a customer segment; Shopify Help Center: Shopify-based customer segment filters; Shopify developer changelog: Updated function syntax on the segment query language (Oct 1, 2026). Not affiliated with, endorsed by, or sponsored by Shopify Inc. Shopify is a trademark of Shopify Inc.