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.

Abandoned checkout date

Name: 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 {date1} AND {date2}
Doesn't exist: IS NULL
Exists: IS NOT NULL
Values
Format Absolute date: YYYY-MM-DD
Date offset examples: -4w, -10y
Named date:
  • Today: = today
  • Yesterday: = yesterday
  • In the last 7 days: >= 7_days_ago
  • In the last 30 days: >= 30_days_ago
  • In the last 90 days: >= 90_days_ago
  • In the last 12 months: >= 12_months_ago
The named dates are default values and can't be changed. For custom dates, use a date offset.
Example Include customers who last abandoned their cart within the last week:
abandoned_checkout_date >= 7_days_ago

Include customers who last abandoned their cart within the last eight months:
abandoned_checkout_date > -8m
NotesDate values are based on entire days and depend on which time zone your store is in.

Anniversary

Name: anniversary

Includes customers by the date of the event associated with the date parameter.

Function parameters Specify the event that you want to filter on. For example: 'metafields.facts.birth_date'
Operators MATCHES: Parameter is true.
NOT_MATCHES: Parameter is false.
IS NULL: Parameter doesn't exist.
IS NOT NULL: Parameter exists.

For dates, the available operators include:
Is equal to: =
Is not equal to: !=
Greater than: >
Smaller than: <
Smaller or equal to: <=
Greater or equal to: >=
Between: BETWEEN
Values date
Format Absolute date: YYYY-MM-DD
Date offset examples: +4w, +3m
Named dates or ranges:
  • Today: = today
  • In the next 7 days: BETWEEN today AND +7d
  • In the next 30 days: BETWEEN today AND +30d
Example Include customers with a birthday in the next 30 days:
anniversary MATCHES ('metafields.facts.birth_date') BETWEEN today AND +30d
Notes
  • The anniversary filter doesn't account for the year.
  • Date values are based on entire days and depend on which time zone your store is in.
  • To filter on birth dates, you need to either activate the facts.birth_date standard metafield or create your own custom metafield. Learn more about adding standard metafields or creating custom metafield definitions.

Amount spent

Name: 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, aren't accepted.
Language-specific formatted numbers aren't accepted.
Example Include customers who have spent 1 to 999.99 in your store:
amount_spent BETWEEN 1 AND 999.99
Notes
  • The currency that's used is based on the currency that's selected for your store. Don't specify which currency is used by entering a currency symbol.
  • BETWEEN includes both the start and the end values. For example, amount_spent BETWEEN 1 AND 100 includes customers who have spent at least 1 and as much as 100.

Cities

Name: 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's displayed.

Companies

Name: companies

Includes customers from companies that have been configured as B2B 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
ValuesCompany ID
Format
Example Is a B2B customer:
companies IS NOT NULL
Isn't a B2B customer:
companies IS NULL
Includes customers who are affiliated with a specific company:
companies CONTAINS 3778915041302
Notes
  • When you create the customer segment, you can select the company by its name from the list that's displayed. Alternatively, you can start typing the title of the company, and then select it from the list.
  • The company ID, not the company name, is entered into the code. When you hover your cursor over the company ID, the company name is displayed.

Countries or regions

Name: 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 the ISO two-letter country code.
Format
Example Include customers who have an address in the United 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's displayed.

Created by app id

Name: created_by_app_id

Includes customers who have been created by the specified app.

Operators Is equal to: =
Isn't equal to: !=
ValuesThe ID of the app to segment on.
FormatApp ID
Example Include customers who have been created in the Shopify admin:
created_by_app_id = 1830279
Notes
  • When you create the customer segment, you can select an app by its name from the list that's displayed. Alternatively, you can start typing the name of the app, and then select it from the list.
  • The app ID, not the app name, is entered into the code. When you hover your cursor over the app ID, the app name is displayed.

Customer account status

Name: customer_account_status

Includes the customers who have the specified customer account status.

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, or your store is using the new customer accounts.
Enabled: 'ENABLED' The customer created an account.
Invited: 'INVITED' The customer has been invited to create an account, but has not yet accepted or declined.
Format
Example Include customers who have been invited to create an account, but declined:
customer_account_status = 'DECLINED'
Notes

Customer added date

Name: 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 {date1} AND {date2}
Values
Format Absolute date: YYYY-MM-DD
Date offset examples: -4w, -10y
Named date:
  • Today: = today
  • Yesterday: = yesterday
  • In the last 7 days: >= 7_days_ago
  • In the last 30 days: >= 30_days_ago
  • In the last 90 days: >= 90_days_ago
  • In the last 12 months: >= 12_months_ago
The named dates are default values and can't be changed. For custom dates, use a date offset.
Example Include customers who were added within the last week:
customer_added_date >= 7_days_ago

Include customers who were added within the last eight months:
customer_added_date > -8m

Include customers who were added during a specific date range:
customer_added_date BETWEEN 2022-12-01 AND 2022-12-31
Notes Date values are based on entire days and depend on which time zone your store is in.

Customer email domain

Name: 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: =
Isn't 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: 'gmail.com'
  • Yahoo: 'yahoo.com' or 'yahoo.ca'
  • Hotmail: 'hotmail.com'
  • AOL: 'aol.com'
  • MSN: 'msn.com'
  • Live: 'live.com'
  • Outlook: 'outlook.com'
Format
Example Include customers whose email domain is shopify.com:
customer_email_domain = 'shopify.com'
Notes

Customer language

Name: customer_language

Includes customers based on the language that the customer uses to communicate with your store.

Operators Is equal to: =
Isn't 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:
customer_language = 'en'

Exclude customers who communicate with your store in Canadian English:
customer_language != 'en-CA'
Notes
  • You can add the locale ISO code to the value to specify a dialect for that language. For example, you can use 'en-US' for the United States and 'en-GB' for the United Kingdom, or 'pt-PT' for Portugal and 'pt-BR' for Brazil.
  • The filter value acts as a wildcard if only the language prefix is specified. For example, if the filter value is 'en', then your results include customers whose language is set to 'en' and customers whose language is set to 'en-GB', 'en-CA', and so on.

Customer tags

Name: 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
ValuesThe name of a customer tag.
Format
Example Include customers who have the GoldStatus tag:
customer_tags CONTAINS 'GoldStatus'
Notes Tags are not case sensitive.
Learn more about tags and their considerations.

Customer within distance

Name: customer_within_distance

Includes customers within a specified distance of a saved location.

Function parameters You can use only one distance parameter for each filter.
coordinates (required): Use this parameter to specify the pin location you want to use to create your segment.
distance_km (required): Use this parameter to specify the distance radius you want to search within for customers.
distance_mi (required): Use this parameter to specify the distance radius you want to search within for customers.
Operators MATCHES: Parameter is true.
NOT_MATCHES: Parameter is false.
IS NULL: Parameter doesn't exist.
IS NOT NULL: Parameter exists.

Value
Format Supported format for coordinates:
  • Number (latitude), Number (longitude)

  • Supported format for coordinates (latitude, longitude):
  • Number: #

  • Supported format for distance_mi, distance_km:
  • Number: #

  • Example This filter requires coordinates and one distance parameter to be valid.

    Filter customers who have an address within 10 miles of coordinates (45.419190, -75.696727):
    customer_within_distance MATCHES (coordinates = (45.419190, -75.696727), distance_mi = 10 )

    Filter can be used in conjunction with other filters to narrow your customer list down even further. For example:
    Filter customers who have address within 20 kilometers of coordinates (43.634,-79.412) and have placed at least one order:
    customer_within_distance MATCHES (coordinates = (43.634,-79.412), distance_km = 20 ) AND number_of_orders > 0
    Notes
    • Shopify Segmentation automatically converts your saved locations to a coordinate pair displaying them as selectable values when using this filter.
    • If your store has saved locations, then Shopify Magic automatically translates the coordinate pair to your location name in the magic translation. For example: "Customers who have an address within 10 miles of the location 'Salt Lake City Store'."

    Email events

    Name: 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 (optional): Use this parameter to specify the number of times an email event occurred.
    date (optional): Use this parameter to specify the date of the event.
    Operators MATCHES: Used when the event has happened.
    NOT_MATCHES: Used when the event didn't happen.
    IS NULL: Parameter doesn't exist.
    IS NOT NULL: Parameter exists.

    For dates, the available operators include:
    Is equal to: =
    Isn't equal to: !=
    Greater than: >
    Smaller than: <
    Smaller or equal to: <=
    Greater or equal to: >=
    Between: BETWEEN
    Value
    FormatSupported formats for activity_id:
  • = (single value)
  • IN : A set of comma-separated values with implicit "OR", wrapped in parentheses. For example: (activity_id IN 1, 2, 3). There is a limit of 500 activity IDs in a set.

    Supported date formats for date:
  • 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:
  • Number: #

  • Example Specify whether an email event happened using a MATCHES or NOT MATCHES operator:
    shopify_email.opened MATCHES (activity_id = 135195754518)
    shopify_email.opened NOT MATCHES (activity_id = 135195754518)

    Use the parameter activity_id to specify the marketing activity ID that you want to filter on:
    shopify_email.delivered MATCHES (activity_id = 135195754518)

    Use the parameter date and the operator >= to specify a start date for an email event:
    shopify_email.delivered NOT_MATCHES (activity_id = 135195754518, date >= 2022-01-01)

    Use the parameter date and the operator <= to specify an end date for an email event:
    shopify_email.delivered MATCHES (activity_id = 135195754518, date <= 2022-01-01)

    Use the parameter date and the operator BETWEEN to specify both a start and end date for an email event:
    shopify_email.bounced NOT_MATCHES (activity_id = 135195754518, BETWEEN -12m AND today)
    Notes
    • When you create a customer segment using the activity_id parameter, you can select the marketing activity by its name from the list that's displayed.
    • Due to data retention, the absence of date parameters means that results will be filtered for the last 26 months, with no set start or end date.
    • Absence of activity_id means that your filter includes all Shopify email activities.

    Email subscription status

    Name: email_subscription_status

    Includes customers based on whether they're subscribed to your marketing email.

    Operators Is equal to: =
    Isn't 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.
    Unsubscribed: 'UNSUBSCRIBED' The customer has unsubscribed from your marketing emails.
    Redacted: 'REDACTED' The customer’s email address has been redacted.
    Format
    Example Include customers who have subscribed to your email marketing:
    email_subscription_status = 'SUBSCRIBED'
    Notes

    First order date

    Name: first_order_date

    Includes customers who placed their first 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 {date1} AND {date2}
    Doesn't exist: IS NULL
    Exists: IS NOT NULL
    Values
    Format Absolute date: YYYY-MM-DD
    Date offset examples: -4w, -10y
    Named date:
    • Today: = today
    • Yesterday: = yesterday
    • In the last 7 days: >= 7_days_ago
    • In the last 30 days: >= 30_days_ago
    • In the last 90 days: >= 90_days_ago
    • In the last 12 months: >= 12_months_ago
    The named dates are default values and can't be changed. For custom dates, use a date offset.
    Example Include customers whose first order was placed since last week:
    first_order_date >= 7_days_ago

    Include customers whose first order was placed since eight months ago:
    first_order_date > -8m
    Notes Date values are based on entire days and depend on which time zone your store is in.

    Last order date

    Name: 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 {date1} AND {date2}
    Doesn't exist: IS NULL
    Exists: IS NOT NULL
    Values
    Format Absolute date: YYYY-MM-DD
    Date offset examples: -4w, -10y
    Named date:
    • Today: = today
    • Yesterday: = yesterday
    • In the last 7 days: >= 7_days_ago
    • In the last 30 days: >= 30_days_ago
    • In the last 90 days: >= 90_days_ago
    • In the last 12 months: >= 12_months_ago
    The named dates are default values and can't be changed. For custom dates, use a date offset.
    Example Include customers whose last order was placed since last week:
    last_order_date >= 7_days_ago

    Include customers whose last order was placed since eight months ago:
    last_order_date > -8m
    Notes Date values are based on entire days and depend on which time zone your store is in.

    Number of orders

    Name: number_of_orders

    Includes customers based on the number of orders that they have placed in your store.

    Operators Is equal to: =
    Isn't equal to: !=
    Greater than: >
    Smaller than: <
    Smaller or equal to: <=
    Greater or equal to: >=
    Between: BETWEEN
    ValuesThe 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

    Name: orders_placed

    Includes customers who placed orders or spent a certain amount during a specified date range.

    Function parameters app_id (optional): Use this parameter to specify which app created the order.
    location_id (optional): Use this parameter to specify which location the order was placed from.
    count (optional): Use this parameter to specify the exact number of times an order was placed.
    amount (optional): Use this parameter to specify the exact amount spent on an order.
    sum_amount (optional): Use this parameter to specify the amount spent on all orders.
    date (optional): Use this parameter to specify a date for the event.
    Operators MATCHES: Parameter is true.
    NOT_MATCHES: Parameter is false.
    IS NULL: Parameter doesn't exist.
    IS NOT NULL: Parameter exists.

    For dates, the available operators include:
    Is equal to: =
    Isn't equal to: !=
    Greater than: >
    Smaller than: <
    Smaller or equal to: <=
    Greater or equal to: >=
    Between: BETWEEN
    Values
    Format Supported formats for count, amount, and sum_amount:
    Number: #

    Supported formats for date:
    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: today
    • Yesterday: yesterday
    The named dates are default values and can't be changed.
    Example Specify whether an order has been placed using a MATCHES or NOT_MATCHES operator:
    orders_placed MATCHES ()
    orders_placed NOT_MATCHES ()

    Filter customers that placed more than 3 orders (inclusive) in the last 6 months:
    orders_placed MATCHES (count >= 3, date >= -6m)

    Filter customers that spent more than $1000 (inclusive) in the last 90 days:
    orders_placed MATCHES (sum_amount >= 1000, date >= -90d)

    Filter customers that spent less than $100 (inclusive) in the last 7 days:
    orders_placed MATCHES (sum_amount <= 100, date >= -7d)

    Filter customers that spent more than $1000 (inclusive) and placed more than 3 orders (inclusive) since January 1, 2023:
    orders_placed MATCHES (sum_amount >= 1000, count >= 3, date >= 2023-01-01)

    Use the parameter date and the operator BETWEEN to specify a specific date range. You can express between January 1, 2023 and June 1, 2023 (inclusive) in the following way:
    orders_placed MATCHES (count >= 3, BETWEEN 2023-01-01 AND 2023-06-01)
    Notes
    • When you hover your cursor over the amount, the currency used to filter your customers is displayed.
    • When you hover your cursor over the following syntax:
      amount, sum_amount the description of the syntax is displayed.
    • Absence of parameters means that your filter includes all orders placed for all time.

    Predicted spend tier

    NAME: predicted_spend_tier

    Includes customers who are within the specified predicted spend tier. Learn more about predicted spend tier.

    Operators Is equal to: =
    Isn't 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

    Name: product_subscription_status

    Includes customers who have the specified product subscription status.

    Operators Is equal to: =
    Isn't 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

    Name: 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 (optional): Use this parameter to specify the quantity of products purchased per order.
    sum_quantity (optional): Use this parameter to specify the quantity of products purchased across all orders.
    date (optional): Use this parameter to specify a date for the event.
    tag (optional): Use this parameter to specify a product tag for purchased products that you want to filter.
    Operators MATCHES: Parameter is true.
    NOT_MATCHES: Parameter is false.
    IS NULL: Parameter doesn't exist.
    IS NOT NULL: Parameter exists.

    For dates, the available operators include:
    Is equal to: =
    Isn't equal to: !=
    Greater than: >
    Smaller than: <
    Smaller or equal to: <=
    Greater or equal to: >=
    Between: BETWEEN
    Value
    Format Supported formats for tag:
    string (single value)

    Supported formats for id:
  • = (single value)
  • IN : A set of comma-separated values with implicit "OR", wrapped in parentheses. For example: (id IN 1012132033639, 2012162031638, 32421429314657). There is a limit of 500 product IDs in a set.

    Supported date formats:
    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 and sum_quantity:
    Number: #
  • Example Specify whether a product has been purchased using a MATCHES or NOT_MATCHES operator:
    products_purchased MATCHES (id = 2012162031638)
    products_purchased NOT_MATCHES (id IN 2012162031638, 1012132033639) products_purchased MATCHES (tag = 'red')

    Filter customers that purchased a specific product since January 1, 2022 until today:
    products_purchased MATCHES (id = 1012132033639, BETWEEN 2022-01-01 AND today)

    Filter customers that purchased a product with the tag 'red' since January 1, 2022 until today:
    products_purchased MATCHES (tag = 'red', BETWEEN 2022-01-01 AND today)

    Within the last 30 days:
    products_purchased MATCHES (date >= -30d)

    Until January 1, 2022:
    products_purchased MATCHES (date <= 2022-01-01)

    Use the parameter date and the operator BETWEEN to specify a specific date range. You can express between January 1, 2022 and June 1, 2022 (inclusive) in the following way:
    products_purchased MATCHES (id = 1012132033639, BETWEEN 2022-01-01 AND 2022-06-01)

    Filter customers that have recently purchased a lot of products with a specific tag:
    products_purchased MATCHES (tag = 'product_tag', sum_quantity >= 3, date >= -90d)
    Notes
    • When you create the customer segment using the id parameter, you can select the product by its name or image from the list that's displayed. Alternatively, you can start typing the title of the product, and then select it from the list.
    • The product ID, not the product title, is entered into the code. When you hover your cursor over the product ID, the product title and image are displayed.
    • Absence of both date parameters means that results will be filtered for all time, with no set start or end date.
    • Absence of any parameters means that your filter includes all products purchased for all time.

    RFM group

    Name: rfm_group

    Includes customers based on which RFM group they're categorized into. Learn more about RFM customer analysis.

    List of possible RFM group operators and values, including examples.
    Operators Is equal to: =
    Isn't equal to: !=
    Doesn't exist: IS NULL
    Exists: IS NOT NULL
    Values Dormant: 'DORMANT'
    At risk: 'AT_RISK'
    Previously loyal: 'PREVIOUSLY_LOYAL'
    Needs attention: 'NEEDS_ATTENTION'
    Almost lost: 'ALMOST_LOST'
    Loyal: 'LOYAL'
    Promising: 'PROMISING'
    Active: 'ACTIVE'
    New: 'NEW'
    Champions: 'CHAMPIONS'
    Prospects: 'PROSPECTS'
    Format
    Example Include customers in the RFM group Needs Attention:
    rfm_group = 'NEEDS_ATTENTION'
    Notes

    SMS subscription status

    Name: sms_subscription_status

    Includes customers based on whether they're subscribed to your marketing SMS text messages. Learn more about collecting customer contact information.

    Operators Is equal to: =
    Isn't 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 request.
    Unsubscribed: '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

    Name: 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
    ValuesUse the ISO country 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's displayed.

    Store credit accounts

    Name: store_credit_accounts

    Includes customers who have a store credit balance on your store.

    Function parameters balance (optional): Use this parameter to specify the customer's current store credit account balance.
    currency (optional): Use this parameter to specify the currency of the customer's store credit balance.
    next_expiry_date (optional): Use this parameter to specify the date of the soonest expiring unspent store credit.
    last_credit_date (optional): Use this parameter to specify the date when the customer last received store credit.
    Operators MATCHES: Parameter is true.
    NOT_MATCHES: Parameter is false.
    IS NULL: Parameter doesn't exist.
    IS NOT NULL: Parameter exists.

    For dates, the available operators include:
    Is equal to: =
    Isn't equal to: !=
    Greater than: >
    Smaller than: <
    Smaller or equal to: <=
    Greater or equal to: >=
    Between: BETWEEN
    Values
    Format Supported formats for currency:
    Currency code: For example USD

    Supported formats for balance:
    Number: #

    Supported formats for next_expiry_date and last_credit_date:
    Absolute dates: YYY-MM-DD
    Date offset examples:
    7 days ago: -7d
    4 weeks ago: -4w
    3 months ago: -3m
    1 year ago: -1y
    Named dates:
  • Today: today
  • Yesterday: yesterday
  • The named dates are default values and can't be changed.
    Example Filter customers who have a store credit account balance greater than or equal to 1 in any currency:
    store_credit_accounts MATCHES (balance >= 1)

    Filter customers who have a store credit account balance greater than or equal to $1 USD:
    store_credit_accounts MATCHES (balance >= 1, currency: 'USD')

    Filter customers with store credit expiring in the next 7 days:
    store_credit_accounts MATCHES (next_expiry_date <= +7d)

    Filter customers who last received store credit more than 1 month ago but still have a balance available to spend:
    store_credit_accounts MATCHES (last_credit_date <= -1m, balance >= 1)
    Notes
    • Customers have a store credit account if you've ever issued store credit to them. A customer's store credit balance can be greater than or equal to 0.
    • Store credit accounts are specific to a currency. If you don't include a currency parameter in your segment, then your filter returns all store credit accounts regardless of the currency type.
    • A customer can have 0 to many store credit accounts, depending on how many currencies you support. For example, if you issue store credit to a customer in both CAD and USD, then that customer has 2 store credit accounts.

    Storefront events

    Name: 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.
    date (optional): Use this parameter to specify a date for the event.
    count (optional): Use this parameter to specify the exact number of times a product or collection was viewed.

    Product 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 MATCHES: Parameter is true.
    NOT_MATCHES: Parameter is false.
    IS NULL: Parameter doesn't exist.
    IS NOT NULL: Parameter exists.

    For dates, the available operators include:
    Is equal to: =
    Isn't equal to: !=
    Greater than: >
    Smaller than: <
    Smaller or equal to: <=
    Greater or equal to: >=
    Between: BETWEEN
    Value
    Format Supported formats for id:
  • = (single value)
  • IN : A set of comma-separated values with implicit "OR", wrapped in parentheses. For example: (id IN 1012132033639, 2012162031638, 32421429314657). There is a limit of 500 product or collection IDs in a set.

    Supported formats for tag: string (single value)

    Supported date formats: Absolute date: YYYY-MM-DD
    Date offset examples:
    • 7 days ago: -7d
    • 4 weeks ago: -4w
    • 3 month ago: -3m
    • 1 year ago: -1y
    Named dates:
    • Today: today
    • Yesterday: yesterday
    Storefront events are available for the last 26 months, with data starting on May 2023.

    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 MATCHES or NOT_MATCHES operator: storefront.product_viewed MATCHES()
    storefront.collection_viewed NOT_MATCHES ()

    Use the parameter id to specify the products that you want to filter on:
    storefront.product_viewed MATCHES (id = 2012162031638)
    storefront.collection_viewed MATCHES (id IN 2012162031638, 456, 789)

    Use the parameter tag to the product tags you want to filter on:
    storefront.product_viewed MATCHES (tag = 'jeans')

    Use the parameter date and the operator >=to specify a start date for a storefront event:
    storefront.product_viewed MATCHES (id = 2012162031638, date >= 2023-04-03)
    storefront.collection_viewed MATCHES (id = 2012162031638, date >= -30d)

    Use the parameter date and the operator <= to specify an end date for a storefront event:
    storefront.product_viewed MATCHES (id = 2012162031638, date <= 2023-04-30)
    storefront.collection_viewed MATCHES (id = 2012162031638, date <= -7d)

    Use the parameter date and the operator BETWEEN to specify both a start and end date for a storefront event:
    storefront.product_viewed MATCHES (id = 2012162031638, BETWEEN 2023-04-03 AND 2023-04-30)
    storefront.collection_viewed MATCHES (id = 2012162031638, BETWEEN -90d AND -30d)

    Filter customers that viewed a specific product in the last 30 days:
    storefront.product_viewed MATCHES (id = 2012162031638, date >= -30d)

    Filter customers that viewed a specific collection since January 1, 2023 until today:
    storefront.collection_viewed MATCHES (id = 2012162031638, BETWEEN 2023-01-01 AND today)
    Notes
    • When you create the customer segment using the id parameter, you can select the product or collection by its name or image from the list that's displayed. Alternatively, you can start typing the title of the product or collection, and then select it from the list.
    • The product or collection ID, not the title, is entered into the code. When you hover your cursor over the ID, the product or collection title and image are displayed.
    • Collections use the image saved as the collection thumbnail, when applicable. If not, then a generic image placeholder is displayed.
    • Due to data retention, the absence of date parameters means that results will be filtered for the last 26 months, with no set start or end date.
    • Absence of id means that your filter includes all products.
    Can’t find the answers you’re looking for? We’re here to help.