Insights · Nov 12, 2026 · 4 min read · FAQ

Building Shopify customer segments for targeted offers and emails

Segments group Shopify customers by what they bought and did, and stay current on their own. What to build first, and how to use them for offers.

CUSTOMER SEGMENTSTargeted offers in Shopify SELLWRIGHT

Most stores send the same offer to everyone, so a first-time buyer and a customer on their tenth order get the same email and the same code. Shopify's customer segments fix that by grouping customers on what they bought and what they did, and they keep themselves up to date. Here is what we set up first in the segment editor and how we put segments to work.

What does a customer segment actually do?

A segment is a saved, rule-based list of customers that Shopify maintains for you. You build it under Customers in the segment editor, where each segment is a ShopifyQL query: Shopify sets the FROM and SHOW parts, and you write the WHERE part from filters, operators and values. Customers join when they start matching the rules and drop out when they stop, so there is nothing to re-import. Test and deleted orders are left out of the calculations.

Which filters should you build first?

Start with what customers bought and when, because order data is the most reliable signal a store has. These are the filters we reach for first:

  • products_purchased: who bought a given product or anything with a product tag, optionally within a date range.
  • number_of_orders and amount_spent: first-time buyers, repeat buyers and your biggest spenders.
  • first_order_date and last_order_date: new customers and those who have gone quiet. Dates accept offsets such as -30d or -12m.
  • email_subscription_status: who has agreed to receive marketing email.
  • Behaviour filters: abandoned checkout dates, Shopify email events such as opened and clicked, and storefront views of a product or collection.

Conditions join with AND and OR. Shopify evaluates AND before OR unless you add brackets, so bracket any mixed query to make the intent obvious. Email subscribers who bought anything tagged Sports wear in the last 12 months look like this:

products_purchased MATCHES (tag = 'Sports wear', date >= -12m) AND email_subscription_status = 'SUBSCRIBED'

The tag is a product tag taken from Shopify's own example, so swap in one your catalogue uses.

Should you start from a template or write the query?

Start from a template and edit it. On the Customers page, the Templates panel fills the editor with a ready-made set of filters; you can browse templates by category and add a second one before changing anything. Select Run query to see who matches and how many, then save the segment with a name. If the query is invalid, the editor underlines the error and suggests fixes when you hover over it.

Two built-in signals are worth knowing. RFM analysis in Shopify's customer reports sorts customers into 11 groups, such as Champions, At risk and Dormant, and its Preview segment action opens the editor with that group applied. Predicted spend tier labels customers High, Medium or Low on likely future spend, once a store has made over 100 sales.

How do you email a segment?

Open the segment, select Use segment, then Email, and build the campaign in Shopify Messaging. You can also pick a segment in the To field of a new campaign. Only customers who have subscribed to your emails receive it, so the segment count is often higher than the real audience. Adding email_subscription_status = 'SUBSCRIBED' to the query brings the count closer to the number of people you will reach. After the send, the email event filters let you build a follow-up for people who opened or clicked that campaign.

How do you limit a discount to a segment?

In the discount's Eligibility section, choose Customer segments and add the segments that may use it, or open a segment and select Use segment, then Discount. An automatic discount can target up to 5 segments and a discount code up to 100.

The catch is first-time buyers. A segment-specific discount applies only to existing customers: someone checking out for the first time has no customer profile yet and joins segments only after that first order completes. A segment of customers with zero orders therefore reaches people who have a profile but have not bought, not brand new visitors. How segment discounts combine with other offers is a separate question, covered in Shopify discount combinations.

How do you keep segments useful over time?

Treat segments like any shared setting: clear names, an owner and a regular tidy-up.

  • Name each segment for who is in it and what it is for. "Bought Sports wear, 12 months, subscribed" tells the next person more than "Spring promo".
  • Read the AI-generated description when you save, and edit it so it states the purpose.
  • Open a segment before quoting its size: the count refreshes when you view it or when an app such as Shopify Messaging uses it.
  • Rename from More actions, and only when no other segment is being edited.
  • Delete one-off campaign segments when the campaign ends, after checking that no live discount still uses them.

Where to start

List the three offers you send most often and who each one is really for. Build one segment per offer from a template, run it, check the count against what you expect and name it clearly. Use each for one email and one discount before building more. If you would like segments, discounts and the automation around them set up properly, our Shopify development service covers it.

FAQ

Frequently asked questions

Can we export a customer segment to a spreadsheet?

Yes. Open the segment, select More actions, then Export, choose a CSV for Excel or Numbers or a plain CSV file, and select Export customers. It suits a one-off review, but the file is a snapshot of that moment, so keep using the live segment for emails and discounts.

Why does a new segment show no customers?

On stores with many customers, a segment can take a few moments to finish calculating, so an empty result straight after running the query may just mean it is still updating. Wait and refresh. Recent changes to customer tags or subscription status can also take a short time to show in segment membership.

Can a customer joining a segment start a Shopify Flow workflow?

Yes. Shopify Flow has a Customer joined segment trigger that starts a workflow when a customer enters a segment you select. Typical uses are adding a customer tag or updating a customer note, so your team or other apps can act on the change without checking the segment by hand.

Should we use customer tags or segments?

Use both, for different jobs. Tags are labels a person or an app adds to a customer, while segments are rules Shopify keeps recalculating. Tag customers for facts order data cannot show, such as an approved trade account, then use the customer_tags filter so a segment picks them up.

Can a segment discount also be limited to one use per customer?

Yes. Eligibility and usage limits are separate settings on the same discount. Eligibility decides which segments can use it, and Limit to one per customer, which tracks the customer's email address or phone number, stops the same person using it more than once.

How far back do email and browsing filters go?

Shopify keeps email events and storefront events, such as product views, for the last 26 months. If you leave out a date in those filters, results cover that 26-month window. For older behaviour, rely on order-based filters like products purchased and last order date instead.

Next step

Ready for a website that sells?

Book a short call. We will look at your current site, agree what matters most and send a written scope with a fixed quote.

Book a callOr write to hello@sellwrightstudio.com