Components of a customer segment
Customer segments are composed of one or morefilters. A filter is built using afilter name, anoperator, and avalueas its components.
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反对nectorsbetween each filter. A customer segment that uses multiple filters is built in the following way:
Learn more about the specificfilters that are used to build customer segments.
On this page
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 theemail_subscription_status
filter name.
Functions
You can use functions to add optional parameters to a filter. The additional parameters are added in parentheses after the filter name.
For example, you can add a parameter using a marketing activity ID to help filter all your customers who have opened a certain email:shopify_email.opened(activity_id: 123) = true
The following are supported function attributes:
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 value5
, that is,>=5
.
以下是其他运营商的例子:
- Between:
BETWEEN
AND - 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 whichoperatorsare available for each filter name.
Using theIS NULLandIS NOT NULLoperator and value paired suggestions
TheIS NULL
operator and value paired suggestion is used to filter customers for whom value data doesn't exist for the given filter. TheIS NOT NULL
operator and value paired suggestion is used to filter customers for whom any value data does exist for the given filter.IS NOT NULL
means that a value has data that exists, and includes all customers who have any value and not a specific value.
IS NULL |
To create a customer segment of customers who have never abandoned a cart at checkout, use theIS NULL operator and value paired suggestion. The customer segment is customers whose profiles don't have any value entered in the abandoned checkout date field.In the editor, the customer segment is the following: abandoned_checkout_date IS NULL |
---|---|
IS NOT NULL |
To create a customer segment of all customers who have abandoned a cart at checkout before, use theIS NOT NULL operator and value paired suggestion. The customer segment is all customers whose profiles have a value entered in the abandoned checkout date field.In the editor, the customer segment is the following: abandoned_checkout_date IS NOT NULL |
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 theAND
andOR
反对nectors. Connectors help you to make the focus of your customer segment as broad or as narrow as you need it to be.
- The
AND
反对nector narrows the focus of your customer segment because a customer must meet all the criteria to be included. - The
OR
反对nector 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 theAND反对nector
To create a customer segment that includes only your email subscribers who have placed five or more orders, use theAND
反对nector to combine the two filters.
Conceptually, this customer segment is the following:
Customers who subscribe to your marketing emailsandcustomers 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 theOR反对nector
To create a customer segment that includes your email subscribersorcustomers who have placed five or more orders, use theOR
反对nector to combine the two filters.
Conceptually, that customer segment is the following:
Customers who subscribe to your marketing emailsorcustomers 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 theANDandOR反对nectors
You can combine several filters using bothAND
andOR
反对nectors. The best practice is to group your filters using brackets.
If you don't use brackets, then the filters that are combined usingAND
are applied before the filters that are combined usingOR
.
Customer segments with brackets
If you want to limit your customer segment to your email subscribers who have either spent more than 100 USDorwho 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, theOR
反对nector is applied before theAND
反对nector. 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, theAND
反对nector is applied before theOR
反对nector. This means the filter is interpreted as if you had included these brackets:
amount_spent > 100 OR (number_of_orders >= 5 AND email_subscription_status = 'SUBSCRIBED')
As a result, your customer segment includes all the following:
- your customers who have spent more than 100 USD, whether or not they subscribe to your emails
- your email subscribers who have placed five or more orders
测试你的理解客户段过滤器components
Use the following example to build your own customer segment on theCustomerspage of your Shopify admin:
(amount_spent > 100 OR number_of_orders >= 5) AND email_subscription_status = 'SUBSCRIBED'
Learn more aboutcreating customer segments.