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.

Open the Segment Builder

By orders and spending

VIP customers
amount_spent >= 500 AND number_of_orders >= 3
First-time buyers in the last 30 days
number_of_orders = 1 AND first_order_date >= -30d
Lapsed: no order in 6 months
number_of_orders >= 1 AND last_order_date < -6m
Spent 1000+ in the last 90 days
orders_placed MATCHES (sum_amount >= 1000, date >= -90d)

Subscriptions and email

Lapsed subscribers you can still email
(product_subscription_status = 'CANCELLED' OR product_subscription_status = 'EXPIRED') AND email_subscription_status = 'SUBSCRIBED'
Subscription payment failed
product_subscription_status = 'FAILED'
Subscribers who never ordered
email_subscription_status = 'SUBSCRIBED' AND number_of_orders = 0
Opening emails, not buying
shopify_email.opened MATCHES (date >= -30d) AND last_order_date < -90d

Behavior and dates

Abandoned a checkout this week
abandoned_checkout_date >= -7d AND email_subscription_status = 'SUBSCRIBED'
Birthdays in the next 30 days (needs the birth date metafield)
anniversary ('metafields.facts.birth_date') BETWEEN today AND +30d
Win-back
(rfm_group = 'AT_RISK' OR rfm_group = 'ALMOST_LOST') AND email_subscription_status = 'SUBSCRIBED'
Shopped in person with Shopify POS
orders_placed MATCHES (app_id = 129785)
Store credit expiring this week
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_tier only appears after 100 sales; product_subscription_status needs a subscription app.

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.