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.
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.
email_subscription_status = 'subscribed'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:
amount_spent > 100 OR number_of_orders >= 5 AND email_subscription_status = 'SUBSCRIBED'(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.
Related guides
- Shopify segments: = true is now MATCHES
- Shopify customer segment query examples
- Dates in Shopify customer segments
- All Segment Builder guides
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.