Shopify-based customer segment filters
Use this reference guide to understand the filter names, operators, and values that are used to build customer segments that are based on the default Shopify filters.
On this page
- Abandoned checkout date
- Anniversary
- Amount spent
- Cities
- Companies
- Countries or regions
- Created by app id
- Customer account status
- Customer added date
- Customer email domain
- Customer language
- Customer tags
- Email events
- Email subscription status
- Last order date
- Number of orders
- Orders placed
- Predicted spend tier
- Product subscription status
- Products purchased
- SMS subscription status
- States or provinces
- Storefront Events
Abandoned checkout date
abandoned_checkout_date
Includes customers by the date that they last abandoned their cart.
Operators | Exactly on date:= Not on date: != On or before date: <= Before date: < On or after date: >= After date: > Between dates: BETWEEN Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | |
Format | Absolute date:YYYY-MM-DD Date offset examples: -4w ,-10y Named date:
|
Example | Include customers who last abandoned their cart within the last week: Include customers who last abandoned their cart within the last eight months: |
Notes | Date values are based on entire days and depend on which time zone your store is in. |
Anniversary
anniversary()
Includes customers by the date of the event associated with the date parameter.
Function parameters | date (required): Use this parameter to specify which event you want to filter on. |
---|---|
Operators | Exactly on date:= Between dates: BETWEEN |
Values | |
Format | Absolute date:YYYY-MM-DD Date offset examples: +4w ,+3m Named date:
|
Example | Include customers with a birthday in the next 30 days: |
Notes |
|
Amount spent
amount_spent
Includes customers based on how much money they have spent in your store.
Operators | Is equal to:= Is not equal to: != Greater than: > Smaller than: < Smaller or equal to: <= Greater or equal to: >= Between: BETWEEN |
---|---|
Values | |
Format | Number range:# AND # Number: # Decimal number: The decimal point (.) is used as the decimal separator. Thousand separators, such as commas or spaces, are not accepted. Language-specific formatted numbers are not accepted. |
Example | Include customers who have spent 1 to 999.99 in your store:amount_spent BETWEEN 1 AND 999.99 |
Notes |
|
Cities
customer_cities
Includes customers who have an address in the specified city. Customers who have multiple addresses might be included in more than one customer segment that uses this filter.
Operators | Contains this exact city:CONTAINS Doesn't contain this exact city: NOT CONTAINS Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | |
Format | countryCode-regionCode-cityCode |
Example | Include customers who have an address in New York City:customer_cities CONTAINS 'US-NY-NewYorkCity' |
Notes | To find a city, you can start typing the name of the city, and then select the appropriate value from the list that is displayed. |
Companies
companies
Includes customers from companies that have been configured asB2B customers.
Operators | Contains this exact company ID:CONTAINS Doesn't contain this exact company ID: NOT CONTAINS Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | Company ID |
Format | |
Example | Is a B2B customer:companies NOT NULL Is not a B2B customer: companies NULL Includes customers who are affiliated with a specific company: companies CONTAINS 3778915041302 |
Notes |
|
Countries or regions
customer_countries
Includes customers who have an address in the specified country or region. Customers who have multiple addresses might be included in more than one customer segment that uses this filter.
Operators | Contains this exact location:CONTAINS Doesn't contain this exact location: NOT CONTAINS Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | Use theISOtwo-letter country code. |
Format | |
Example | 包括统一的客户有一个地址d States:customer_countries CONTAINS 'US' |
Notes | To find a country, you can start typing the name of the country, and then select the appropriate value from the list that is displayed. |
Created by app id
created_by_app_id
Includes customers who have been created by the specified app.
Operators | Is equal to:= Is not equal to: != |
---|---|
Values | The ID of the app to segment on. |
Format | App ID |
Example | Include customers who have been created in the Shopify admin :created_by_app_id = 1830279 |
Notes |
|
Customer account status
customer_account_status
Includes the customers who have the specifiedcustomer accountstatus.
Operators | Is equal to:= Is not equal to: != |
---|---|
Values | Declined:'DECLINED' The customer was invited to create an account, but declined.Disabled: 'DISABLED' The customer has not created an account.Enabled: 'ENABLED' The customer created an account.Invited: 'INVITED' The customer has been invited to create an account. |
Format | |
Example | Include customers who have been invited to create an account, but declined:customer_account_status = 'DECLINED' |
Notes |
Customer added date
customer_added_date
Includes customers based on the date that they were added to your store.
Operators | Exactly on date:= Not on date: != On or before date: <= Before date: < On or after date: >= After date: > Between dates: BETWEEN |
---|---|
Values | |
Format | Absolute date:YYYY-MM-DD Date offset examples: -4w ,-10y Named date:
|
Example | Include customers who were added within the last week: Include customers who were added within the last eight months: Include customers who were added during a specific date range: |
Notes | Date values are based on entire days and depend on which time zone your store is in. |
Customer email domain
customer_email_domain
Includes customers whose email address belongs to the specified domain. The domain name is the part of the email address after the@
symbol, for example,gmail.com
.
Operators | Is equal to:= Is not equal to: != Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | The following domain names are offered as suggestions. You're not limited to these domain names. You can manually enter any other valid domain names. gmail.com:'gmail.com' yahoo.com: 'yahoo.com' hotmail.com: 'hotmail.com' aol.com: 'aol.com' msn.com: 'msn.com' live.com: 'live.com' outlook.com: 'outlook.com' yahoo.ca: 'yahoo.ca' |
Format | |
Example | Include customers whose email domain is shopify.com:customer_email_domain = 'shopify.com' |
Notes |
Customer language
customer_language
Includes customers based on the language that the customer uses to communicate with your store.
Operators | Is equal to:= Is not equal to: != Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | Use the ISO 639-1 two-letter language code. |
Format | The following values are examples of some common ISO language codes. Your data isn't limited to these language codes. You can manually enter any other valid language codes, but the values that are offered to you as suggested values in the editor are the only ones that are available in your customer data. English:'en' French: 'fr' Spanish: 'es' German: 'de' Italian: 'it' Japanese: 'ja' Russian: 'ru' |
Example | Include customers who communicate with your store in English: Exclude customers who communicate with your store in Canadian English: |
Notes |
|
Customer tags
customer_tags
Includes customers based on their tags.
Operators | Contains this exact tag:CONTAINS Doesn't contain this exact tag: NOT CONTAINS Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | The name of a customer tag. |
Format | |
Example | Include customers who have the GoldStatus tag:customer_tags CONTAINS 'GoldStatus' |
Notes | Tags are not case sensitive. |
Email events
shopify_email.EVENT()
Includes customers based on selected email events. Supported events (EVENT) include the following:
- Bounced:
bounced
- Clicked:
clicked
- Delivered:
delivered
- Marked as spam:
marked_as_spam
- Opened:
opened
- Unsubscribed:
unsubscribed
Function parameters | activity_id (optional): Use this parameter to select the marketing activity ID that you want to filter.count_at_least (可选):使用该参数指定迷你mum number of times an email event occurred.count_at_most (optional): Use this parameter to specify the maximum number of times an email event occurred.count (可选):使用该参数指定exact number of times an email event occurred.since (optional): Use this parameter to specify a start date for the event.until (optional): Use this parameter to specify an end date for the event. |
---|---|
Operators | Is equal to:= Is not equal to: != |
Value | true ,false |
Format | Supported formats foractivity_id :ID (single value)List : A set of values with implicit "OR". AList is a set of comma-separated values wrapped with parentheses. For example:(1, 2, 3) . There is a limit of 500 activity IDs in a list.Supported Date formats forsince anduntil :Absolute date: YYYY-MM-DD Date offset examples: 7 days ago: :-7d 4 weeks ago: :-4w 3 months ago: :-3m 1 year ago: :-1y Named date: :today ,:yesterday The named dates are default values and can't be changed. For custom dates, use a date offset. Email events are available for the last 26 months, with data starting on March 2022. Supported formats for count_at_least ,count_at_most ,count :Number: # |
Example | Specify whether an email event happened using a= or!= operator:shopify_email.opened(activity_id: 135195754518) = false shopify_email.opened(activity_id: 135195754518) != true Use the parameter activity_id to specify the marketing activity ID that you want to filter on:shopify_email.delivered(activity_id: 135195754518) = true Use the parameter since to specify a start date for an email event:shopify_email.delivered(activity_id: 135195754518, since: 2022-01-01) = false Use the parameter until to specify an end date for an email event:shopify_email.delivered(activity_id: 135195754518, until: 2022-01-01) = true Use the parameters since anduntil to specify both a start and end date for an email event:shopify_email.bounced(activity_id: 135195754518, since: 12_months_ago, until: today) = false |
Notes |
|
Email subscription status
email_subscription_status
Includes customers based on whether they are subscribed to your marketing email.
Operators | Is equal to:= Is not equal to: != Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | Not subscribed:'NOT_SUBSCRIBED' The customer hasn't subscribed to your marketing email.Subscribed: 'SUBSCRIBED' The customer is subscribed to your marketing email.Pending: 'PENDING' The customer is in the process of subscribing to your marketing email.Invalid: 'INVALID' The customer’s email address marketing state is invalid. |
Format | |
Example | Include customers who have subscribed to your email marketing:email_subscription_status = 'SUBSCRIBED' |
Notes |
Last order date
last_order_date
Includes customers who placed their last order on the date specified.
Operators | Exactly on date:= Not on date: != On or before date: <= Before date: < On or after date: >= After date: > Between dates: BETWEEN Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | |
Format | Absolute date:YYYY-MM-DD Date offset examples: -4w ,-10y Named date:
|
Example | Include customers whose last order was placed since last week: Include customers whose last order was placed since eight months ago: |
Notes | Date values are based on entire days and depend on which time zone your store is in. |
Number of orders
number_of_orders
Includes customers based on the number of orders that they have placed in your store.
Operators | Is equal to:= Is not equal to: != Greater than: > Smaller than: < Smaller or equal to: <= Greater or equal to: >= Between: BETWEEN |
---|---|
Values | The value that you enter must be a whole number. |
Format | Number range:# AND # Number: # |
Example | Include customers who have placed more than 10 orders:number_of_orders > 10 |
Notes | BETWEEN includes both the start and the end values. For example,number_of_orders BETWEEN 1 AND 100 includes customers who have placed at least 1 order and as many as 100 orders. |
Orders placed
orders_placed()
Includes customers who placed orders or spent a certain amount during a specified date range.
Function parameters |
|
---|---|
Operators | Is equal to: Is not equal to: |
Values | true ,false |
Format | Supported formats for Supported formats for Supported formats for Supported 7 days ago: Named date:
The named dates are default values and can't be changed. |
Example | Specify whether an order has been placed using a= or!= operator:
Filter customers that placed more than 3 orders (inclusive) in the last 6 months:
Filter customers that spent more than $1000 (inclusive) in the last 3 months:
Filter customers that spent less than $100 (inclusive) last week:
Filter customers that spent more than $1000 (inclusive) and placed more than 3 orders (inclusive) since January 1, 2023:
In date ranges, the order of the Between January 1, 2023 and June 1, 2023 (inclusive):
Between January 1, 2023 and June 1, 2023 (inclusive):
|
Notes |
|
Predicted spend tier
predicted_spend_tier
Includes customers who are within the specified predicted spend tier.
This filter is only available if your store made more than 100 sales.
Learn more aboutpredicted spend tier.
Operators | Is equal to:= Is not equal to: != Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | 'HIGH' 'MEDIUM' 'LOW' |
Format | |
Example | Include customers who are in the HIGH tier:predicted_spend_tier = 'HIGH' |
Notes |
Product subscription status
product_subscription_status
Includes customers who have the specifiedproduct subscriptionstatus.
This filter is only available if you use a subscription app.
Operators | Is equal to:= Is not equal to: != Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | Active:'SUBSCRIBED' The customer has an active product subscription.Cancelled: 'CANCELLED' The customer has canceled their product subscription.Expired: 'EXPIRED' The customer's product subscription has expired.Failed: 'FAILED' The customer has a failed payment.Never subscribed: 'NEVER_SUBSCRIBED' The customer never subscribed.Paused: 'PAUSED' The customer has paused their product subscription. |
Format | |
Example | Include customers who have an active product subscription:product_subscription_status = 'SUBSCRIBED' |
Notes |
Products purchased
products_purchased()
Includes customers who purchased the specified product. In addition, you can include customers who bought the product during a specified date range.
Function parameters | id (optional): Use this parameter to specify the product a customer has purchased that you want to filter.quantity_at_least (可选):使用该参数指定迷你mum quantity of products purchased per order.quantity_at_most (optional): Use this parameter to specify the maximum quantity of products purchased per order.quantity (optional): Use this parameter to specify the quantity of products purchased per order.sum_quantity_at_least (可选):使用该参数指定迷你mum quantity of products purchased across all orders.sum_quantity_at_most (optional): Use this parameter to specify the maximum quantity of products purchased across all orders.sum_quantity (optional): Use this parameter to specify the quantity of products purchased across all orders.since (optional): Use this parameter to specify a start date for the event.tag (optional): Use this parameter to specify a product tag for purchased products that you want to filter.until (optional): Use this parameter to specify an end date for the event. |
---|---|
Operators | Is equal to:= Is not equal to: != |
Value | true ,false |
Format | Supported formats fortag :String (single value)Supported formats for id :ID (single value)List : A set of values provided as a list. For example:(1012132033639, 2012162031638, 32421429314657) . There is a limit of 500 product IDs in a list.Supported Date formats forsince anduntil :Absolute date: YYYY-MM-DD Date offset examples: 7 days ago: :-7d 4 weeks ago: :-4w 3 months ago: :-3m 1 year ago: :-1y Named date: :today ,:yesterday The named dates are default values and can't be changed. Supported formats for quantity_at_least ,quantity_at_most ,quantity :Number: # Supported formats for sum_quantity_at_least ,sum_quantity_at_most ,sum_quantity :Number: # |
Example | Specify whether a product has been purchased using a= or!= operator:products_purchased() != true products_purchased(id: 2012162031638) = true products_purchased(id: (2012162031638, 1012132033639)) = false products_purchased(tag: 'red') = true Filter customers that purchased a specific product since January 1, 2022 until today: products_purchased(id: 1012132033639, since: 2022-01-01, until: today) = true Filter customers that purchased a product with the tag 'red' since January 1, 2022 until today:products_purchased(tag: 'Red', since: 2022-01-01, until: today) = true Within the last 30 days: products_purchased(since: -30d) = true Until January 1, 2022: products_purchased(until: 2022-01-01) = true In date ranges, the order of the products_purchased(id: 1012132033639, since: 2022-01-01, until: 2022-06-01) = true Between January 1, 2022 and June 1, 2022 (inclusive): products_purchased(id: 1012132033639, until: 2022-06-01, since: 2022-01-01) = true Filter customers that have recently purchased a lot of products with a specific tag: products_purchased(tag: 'product_tag', sum_quantity_at_least: 3, since: -90d) = true |
Notes |
|
SMS subscription status
sms_subscription_status
Includes customers based on whether they are subscribed to your marketing SMS text messages.
Learn more aboutcollecting customer contact information.
Operators | Is equal to:= Is not equal to: != Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | Subscribed:'SUBSCRIBED' The customer is subscribed to your marketing SMS text messages.Pending: 'PENDING' The customer is in the process of subscribing to your marketing SMS text messages.Redacted: 'REDACTED' The customer has pending redaction because of a GDPR erasure requestUnsubscribed: 'UNSUBSCRIBED' The customer has unsubscribed from your marketing SMS text messages.Not subscribed: 'NOT_SUBSCRIBED' The customer never subscribed to your marketing SMS text messages. |
Format | |
Example | Include customers who have subscribed to your marketing SMS text messages:sms_subscription_status = 'SUBSCRIBED' |
Notes |
States or provinces
customer_regions
Includes customers who have an address in the specified region within a country. Customers who have multiple addresses might be included in more than one customer segment that uses this filter.
Operators | Contains this exact location:CONTAINS Doesn't contain this exact location: NOT CONTAINS Doesn't exist: IS NULL Exists: IS NOT NULL |
---|---|
Values | Use theISOcountry code with the ISO 3166-2 subdivision code. |
Format | |
Example | Include customers who have an address in New York State:customer_regions CONTAINS 'US-NY' |
Notes | To find a region, you can start typing the name of the region, and then select the appropriate value from the list that is displayed. |
Storefront Events
storefront.EVENT()
Includes customers based on storefront events. Supported events (EVENT) include the following:
- Product viewed:
product_viewed
- Collection viewed:
collection_viewed
Function parameters | id (optional): Use this parameter to specify the products or collections that you want to filter on.since (optional): Use this parameter to specify a start date for the event.until (optional): Use this parameter to specify an end date for the event.count_at_least (可选):使用该参数指定迷你mum number of times a product or collection was viewed.count_at_most (optional): Use this parameter to specify the maximum number of times a product or collection was viewed.count (可选):使用该参数指定exact number of times a product or collection was viewed. |
---|---|
Event-specific parameters | tag (optional): Use this parameter to specify the product tag you want to filter on. This behaves the same as filtering for every product ID with that tag. |
Operators | Is equal to:= Is not equal to: != |
Value | true ,false |
Format | Supported formats forid :ID (single value)List : A set of values provided as a list. For example:(1012132033639, 2012162031638, 32421429314657) . There is a limit of 500 product IDs in a list.Supported formats for tag :String (single value)Supported YYYY-MM-DD Date offset examples:
The named dates are default values and can't be changed. For custom dates, use a date offset. |
Example | Specify whether a storefront event happened using a= or!= operator:storefront.product_viewed() = true storefront.collection_viewed() = false Use the parameter id to specify the products that you want to filter on:storefront.product_viewed(id: 2012162031638) = true storefront.collection_viewed(id: (2012162031638, 456, 789)) = true Use the parameter tag to the product tags you want to filter on:storefront.product_viewed(tag: 'jeans') = true Use the parameter since to specify a start date for a storefront event:storefront.product_viewed(id: 2012162031638, since: 2023-04-03) = true storefront.collection_viewed(id: 2012162031638, since:-30d) = true Use the parameter until to specify an end date for a storefront event:storefront.product_viewed(id: 2012162031638, until: 2023-04-30) = true storefront.collection_viewed(id: 2012162031638, until:-7d) = true Use the parameters since anduntil to specify both a start and end date for a storefront event:storefront.product_viewed(id: 2012162031638, since: 2023-04-03, until: 2023-04-30) = true storefront.collection_viewed(id: 2012162031638, since: -90d, until: -30d) = true Filter customers that viewed a specific product in the last 30 days: storefront.product_viewed(id: 2012162031638, since: -30d) = true Filter customers that viewed a specific collection since January 1, 2023 until today: storefront.collection_viewed(id: 2012162031638, since: 2023-01-01, until: today) = true In date ranges, the order of the storefront.collection_viewed(id: 2012162031638, since: 2023-01-01, until: 2023-06-01) = true 2023年1月1日至今天(inclusive): storefront.collection_viewed(id: 2012162031638, until: today, since: 2023-01-01,) = true |
Notes |
|