Components of a customer segment

Customer segments are composed of one or more filters. A filter is built using a filter name, an operator, and a value as its components.

The components of a customer segment with one filter

The components of a customer segment filter.
Component Component name
1 filter name
2 operator
3 value

You can use more than one filter in a customer segment. In this case, you use connectors between each filter. A customer segment that uses multiple filters is built in the following way:

A customer segment with two filters joined by the AND connector

Learn more about the specific filters that are used to build customer segments.

Filter names

A filter name is a criterion that is used to select customers for a customer segment. For example, if you want to select all your customers who subscribe to your marketing emails, then you use the email_subscription_status filter name.

Operators

An operator is used to define the relationship between the filter name and the value. For example, if you want to create a segment of customers who have placed five or more orders, then you use the operator >= to indicate greater than or equal to. In this case, you would add the value 5, that is, >=5.

The following are examples of other operators:

  • Between: BETWEEN <value1> AND <value2>
  • Is equal to: =
  • Is not equal to: !=
  • Greater than: >
  • Smaller than: <
  • Smaller or equal to: <=
  • Contains this exact value: CONTAINS
  • Doesn't contain this exact value: NOT CONTAINS

The operators that are available for a filter name depend on which filter name you use. Learn more about which operators are available for each filter name.

Values

A value is the characteristic of a customer that is used to include or exclude the customer from a customer segment. The value is used in combination with the filter name and operator. For example, if you want to select your customers who subscribe to your marketing emails, then you use the value 'SUBSCRIBED'. Customers who don't subscribe to your marketing emails are excluded from the customer segment.

Connectors

If you use multiple filters, then you combine them by using the AND and OR connectors. Connectors help you to make the focus of your customer segment as broad or as narrow as you need it to be.

  • The AND connector narrows the focus of your customer segment because a customer must meet all the criteria to be included.
  • The OR connector broadens the focus of your customer segment because a customer can meet any of the criteria to be included, but doesn't need to meet all the criteria.

Using the AND connector

To create a customer segment that includes only your email subscribers who have placed five or more orders, use the AND connector to combine the two filters.

Conceptually, this customer segment is the following:

Customers who subscribe to your marketing emails and customers who have placed five or more orders.

In the editor, the customer segment is the following:

email_subscription_status = 'SUBSCRIBED' AND number_of_orders >= 5

Your customer segment only includes your email subscribers who have placed five or more orders. The customer segment doesn't include the following:

  • Customers who don't subscribe to your marketing emails.
  • Customers who do subscribe to your marketing emails, but who have placed fewer than five orders.

Using the OR connector

To create a customer segment that includes your email subscribers or customers who have place five or more orders, use the OR connector to combine the two filters.

Conceptually, that customer segment is the following:

Customers who subscribe to your marketing emails or customers who have placed five or more orders.

In the editor, the customer segment is the following:

email_subscription_status = 'SUBSCRIBED' OR number_of_orders >= 5

Your customer segment includes the following:

  • All your email subscribers, whether or not they've placed five or more orders.
  • All your customers who have placed five or more orders, whether or not they subscribe to your emails.

Using both the AND and OR connectors

You can combine several filters using both AND and OR connectors. The best practice is to group your filters using brackets.

If you don't use brackets, then the filters that are combined using AND are applied before the filters that are combined using OR.

Customer segments with brackets

If you want to limit your customer segment to your email subscribers who have either spent more than 100 USD or who have placed five or more orders, then use brackets to build the following customer segment:

(amount_spent > 100 OR number_of_orders >= 5) AND email_subscription_status = 'SUBSCRIBED'

In this case, the OR connector is applied before the AND connector. As a result, your customer segment includes both of the following:

  • your email subscribers who have spent more than 100 USD
  • your email subscribers who have placed five or more orders

Customer segments without brackets

The following customer segment doesn't use brackets:

amount_spent > 100 OR number_of_orders >= 5 AND email_subscription_status = 'SUBSCRIBED'

In this case, the AND connector is applied before the OR connector. As a result, your customer segment includes all the following:

  • your email subscribers
  • the customers who have spent more than 100 USD
  • the customers who have placed five or more orders

Test your understanding of customer segment filter components

Use the following example to build your own customer segment on the Customers page of your Shopify admin:

(amount_spent > 100 OR number_of_orders >= 5) AND email_subscription_status = 'SUBSCRIBED'

Learn more about creating customer segments.

Ready to start selling with Shopify?

Try it free