Customer segments
Shopify customer segment query examples
Ready-made queries for common marketing audiences. Paste one into Customers > Segments in your Shopify admin, or open it in the builder to adjust the numbers.
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.
By orders and spending
amount_spent >= 500 AND number_of_orders >= 3number_of_orders = 1 AND first_order_date >= -30dnumber_of_orders >= 1 AND last_order_date < -6morders_placed MATCHES (sum_amount >= 1000, date >= -90d)Subscriptions and email
(product_subscription_status = 'CANCELLED' OR product_subscription_status = 'EXPIRED') AND email_subscription_status = 'SUBSCRIBED'product_subscription_status = 'FAILED'email_subscription_status = 'SUBSCRIBED' AND number_of_orders = 0shopify_email.opened MATCHES (date >= -30d) AND last_order_date < -90dBehavior and dates
abandoned_checkout_date >= -7d AND email_subscription_status = 'SUBSCRIBED'anniversary ('metafields.facts.birth_date') BETWEEN today AND +30d(rfm_group = 'AT_RISK' OR rfm_group = 'ALMOST_LOST') AND email_subscription_status = 'SUBSCRIBED'orders_placed MATCHES (app_id = 129785)store_credit_accounts MATCHES (balance >= 1, next_expiry_date <= +7d)Things to know
- Values in quotes, such as
'SUBSCRIBED', are case-sensitive. - A query can have up to 10 filters.
- Amounts are in your store currency, without symbols or thousand separators.
predicted_spend_tieronly appears after 100 sales;product_subscription_statusneeds a subscription app.
Related guides
- Segment customers who bought a product
- Why your Shopify segment query isn’t working
- Dates in Shopify customer segments
- All Segment Builder guides
Sources: Shopify Help Center: Shopify-based customer segment filters; Shopify Help Center: Components of a customer segment; shopify.dev: Segment query language reference. Not affiliated with, endorsed by, or sponsored by Shopify Inc. Shopify is a trademark of Shopify Inc.