Skip to content

Shopify tutorials for the person running the store. Orders, discounts, fulfilment, returns.

Create a customer segment in Shopify

A customer segment is a saved group of customers who all match a rule you set: subscribed to email, spent over a threshold, live in a city. Segments update on their own as customer behaviour changes, so the group is never a frozen list. This tutorial builds the simplest useful segment, email subscribers, from a store of 214 customers.

Written · Shopify admin, desktop steps · 4 minutes read

The worked example

Customers in the store214
Email subscribers96
Not subscribed118
Share subscribed44.86%

Download the segment planner: segment-planner.csv (239 bytes, md5 2b20f950aaedd106fe0c81110026d684).

A planner for the first three segments: the query, the customer count, and the share of the store each one holds. Each share is customers divided by 214.

1Open the Segments list

From your Shopify admin, go to Customers, then click Segments at the top of the page. Your existing segments and Shopify's default ones are listed there.

2Create a new segment

Click Create segment. The query editor opens with a default query already in place. Every segment starts with locked FROM customers and SHOW lines you cannot edit; you build the segment by filling in the WHERE line.

3Fill in the WHERE line

Click into the WHERE area and pick a filter name, an operator, and a value. The editor suggests each one as you type, so you do not need to know the query language to start. For email subscribers the filter is email_subscription_status = 'SUBSCRIBED'.

4Run the query before you save

Click Run query. The customers who match are listed below the editor, and the number who match shows above it. This is the live preview: the worked example shows 96 subscribers out of 214 customers. If the count looks wrong, the rule is wrong, and this is the moment to fix it.

5Check the description, then save

Review the AI-generated segment description to make sure it describes the group you meant to build, and change the query if it does not. Click Save segment, enter a clear name such as Email subscribers, and click Save. The segment appears in the Segments list.

The arithmetic

The store has 214 customers.

GroupCustomersShare of the store
Email subscribers9644.86%
Not subscribed11855.14%
All customers214100.00%

96 plus 118 equals 214. 96 divided by 214 is 44.86%, and 118 divided by 214 is 55.14%. The two shares add to 100.00%.

Held at the counter

A filter with no data may not appear. The values suggested in the WHERE line come from your store's data. If your store has no data for a filter yet, typing it in by hand can return an Invalid expression error instead of an empty result.

Run the query before saving. The live count above the editor is the only check that the rule matches the group you meant. A segment saved without running it can quietly hold the wrong customers.

A segment is a live rule, not a list. Customers join and leave as their behaviour changes. Someone who unsubscribes drops out of the email subscribers segment on their own, with no edit from you.

Sources

  • Creating customer segments — Shopify's help pages: the locked FROM and SHOW lines, the WHERE line, the Run query preview, and the Save segment steps.