Customer segments
Segment customers who bought a product
Use the products_purchased filter. It takes product IDs, a product tag, a date, and quantities, written with the 2026-10 MATCHES syntax.
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.
Bought a specific product
products_purchased MATCHES (id = 1012132033639)The ID is the number at the end of the product’s URL in your admin. In the segment editor you can also pick the product by name and Shopify fills in the ID.
Bought any of several products
products_purchased MATCHES (id IN (1012132033639, 2012162031638))Bought one product but not another
products_purchased MATCHES (id = 1012132033639) AND products_purchased NOT MATCHES (id = 2012162031638)By product tag and date
products_purchased MATCHES (tag = 'Sports wear', date >= -12m)products_purchased MATCHES (tag = 'product_tag', sum_quantity >= 3, date >= -90d)quantity is the quantity in one order; sum_quantity is the total across all orders. Leaving out date means all time.
Build it without typing
The Segment Query Builder has a Products purchased filter with fields for IDs, tag, dates and quantities, and writes the query for you.
Related guides
- Shopify customer segment query examples
- Shopify segments: = true is now MATCHES
- Dates in Shopify customer segments
- All Segment Builder guides
Sources: Shopify Help Center: Shopify-based customer segment filters; shopify.dev: Segment query language reference. Not affiliated with, endorsed by, or sponsored by Shopify Inc. Shopify is a trademark of Shopify Inc.