In the ShopifyQL editor in Analytics, MATCHES has been added. In the WHERE clause, you can now filter reports by a customer'sbehavioras a condition. Since you can use the same MATCHES syntax as Customer Segmentation, your segment and report definitions stay consistent.
You could only filter by attributes tied to the customer—country, signup date, tags, and so on.attributes. Behavioral conditions like "people who bought a lot recently" couldn't be written directly in a report.
Behaviors like purchase count, quantity, and time periodbehaviorcan be turned into WHERE clause conditions. For example, you can directly filter for "customers who purchased 2+ items in the last 30 days."
A real example from the article: "customers who purchased 2 or more items in the last 30 days" — the query to extract them:
FROM customers SHOW customer_id, email WHERE products_purchased MATCHES (quantity >= 2, date >= -30d) GROUP BY customer_id
| Clause | Role |
|---|---|
| FROM customers | Targets customer data. |
| SHOW customer_id, email | Specifies the columns to show in the results. |
| WHERE ... MATCHES (...) | This is the key part here.products_purchasedAgainst the action (having purchased a product), narrows down to only the customers that match the conditions inside the parentheses. |
| quantity >= 2 | A quantity of 2 or more. |
| date >= -30d | From the time of execution,relative, within the past 30 days. Represents 'the last 30 days' rather than a fixed date. |
| GROUP BY customer_id | Aggregates by customer. |
The crux of the article is the point that 'the MATCHES logic used in Customer Segmentation works as-is in Analytics too.'Because the same syntax means the same thing, the numbers in segments and reports don't drift apart.
| Item | Regular WHERE (attribute filter) | WHERE ... MATCHES (behavior filter) |
|---|---|---|
| What it narrows down | Who someone is Customer attributes such as country, signup date, and tags | What they did Behavior such as purchase quantity and time period |
| Syntax | column operator value (e.g., country = 'JP') | behavior field MATCHES (condition, condition) |
| Multiple conditions | Joined with AND / OR | List them inside parentheses to evaluate them together against the same behavior |
| Time period | — | You can use relative dates like date >= -30d |
| Consistency with Segmentation | — | Yes The same syntax is shared with segments |
* Attribute filters and behavior filters can be used together (for example, combining "customers in Japan" with "purchased 2 or more items in the last 30 days").
It's used in the ShopifyQL editor within Analytics. You write MATCHES in the WHERE clause.
such as the list of supported fields and upper limits,the detailed limitations are not covered in this article. They are consolidated in the Shopify Help Center, so check there before implementing.
MATCHES is a behavior filter written in the WHERE clause. Use it in combination with existing ShopifyQL syntax such as SHOW / GROUP BY.
You can use the traditional "who they are (attributes)" filters together with the "what they did (behavior)" MATCHES in the same query. You can slice customers along both axes.
You can specify relative dates based on the time of execution, like date >= -30d. There's no need to update fixed dates, so you can templatize reports as "the last N days."
You can bring Customer Segmentation's MATCHES directly into Analytics. The learning curve is shared, making it easy to validate and port segment definitions.
Limitations such as the list of supported behavior fields, whether nesting is allowed, and upper limits are not covered in the article. Before building production queries,check the Help Center's syntax, examples, and limitations, and measure in the editor whether the expected number of results is returned before putting it into production.