Segment attribute reference
This page lists every attribute you can use in the segment editor’s WHERE
clause. For the grammar itself (groups, AND/OR, quoting, parentheses), see
the segment query language reference.
For a walkthrough of building and using segments, see
Customers & segments.
How to read this page
Each attribute has a type, and the type decides which operators it accepts. Rather than repeating the same list on every row, the tables below name one of these operator sets:
| Set | Operators |
|---|---|
| String | =, !=, CONTAINS, NOT CONTAINS, STARTS WITH, ENDS WITH, IN (...), NOT IN (...), IS NULL, IS NOT NULL |
| Enum | =, !=, IN (...), NOT IN (...), IS NULL, IS NOT NULL |
| Number | =, !=, >, >=, <, <=, BETWEEN ... AND ..., IS NULL, IS NOT NULL |
| Money | Same as Number. Values are major currency units: amount_spent > 500 means more than ₹500 (or $500, and so on) |
| Date | =, !=, <, >, <=, >=, BETWEEN ... AND ..., IN LAST n DAYS, NOT IN LAST n DAYS, IN NEXT n DAYS, IS NULL, IS NOT NULL (units: DAYS, WEEKS, MONTHS, YEARS) |
| Recurring date | =, BETWEEN, IN LAST, NOT IN LAST, IN NEXT, IN MONTH May, ON May 24, IS NULL, IS NOT NULL |
| Boolean | = true, = false, !=, IS NULL, IS NOT NULL |
| Tag | CONTAINS 'x', NOT CONTAINS 'x', CONTAINS ALL (...), CONTAINS ANY (...), IS NULL, IS NOT NULL |
| ID | =, !=, IN (...), NOT IN (...), IS NULL, IS NOT NULL. Values are IDs, written unquoted |
| Category | Same operator keys as ID, but subtree semantics (see taxonomy categories) |
| Complex | MATCHES (...), NOT_MATCHES (...), IS NULL, IS NOT NULL (see below) |
List operators (IN, NOT IN, CONTAINS ALL, CONTAINS ANY) accept up to
100 values per condition. Enum values match case-insensitively; the tables
list the canonical spellings.
Number conditions are capped at a magnitude of 1e12, and money values take at most three decimal places.
Not every attribute offers IS NULL
The operator sets above are the maximum an attribute of that type can
accept. IS NULL / IS NOT NULL are only offered where a value can genuinely
be absent, so these always-set attributes leave them out:
number_of_orders, amount_spent, customer_added_date,
customer.account_anniversary, customer_account_status,
email_subscription_status, customer.tax_exempt, customer.is_walkin,
customer.is_guest, customer.has_verified_email,
customer.has_verified_phone, customer.was_referred,
customer.is_b2b_buyer, customer.has_purchased_gift_card,
customer.email_can_receive_marketing,
customer.email_open_tracking_allowed, and
customer.email_click_tracking_allowed.
A customer who has never ordered has number_of_orders = 0, not an empty
value, so write the comparison you mean. customer_language genuinely can be
unset and keeps both operators.
Open and closed enums
Most enums are closed - only the spellings listed in these tables compile.
Three are open, because their options are a convenience list rather than
the whole set: company.id and company.name offer at most 250 companies,
and loyalty.tier offers your store’s current tiers. A value outside the
offered list still compiles and saves on those three; the editor warns that it
doesn’t recognise the value, which keeps queries working on large stores and
across tier renames.
Dates
Date values can be written as:
- an absolute date -
2026-05-25(a datetime like2026-05-25T10:30:00Zalso works on datetime attributes) - a named day -
today,yesterday,tomorrow - an offset from today -
-30d,-4w,-6m,-1y,+7d(days, weeks, months, years; the unit letter may be uppercase, so+7Dalso works) - a duration -
IN LAST 30 DAYS,NOT IN LAST 6 MONTHS,IN NEXT 2 WEEKS
Dates are calendar-checked (2026-02-30 is rejected), timezone offsets are
range-checked, and windows and offsets cap at roughly a century per unit -
36,600 days, 5,300 weeks, 1,200 months, or 100 years. A BETWEEN range whose
bounds invert once they are resolved in the store timezone is reported as an
empty range instead of silently matching nobody.
Recurring-date attributes (anniversaries, birthdays) additionally support
IN MONTH May and ON May 24, which match every year. Those two operators are
exclusive to recurring dates - customer.birthday,
customer.account_anniversary, customer.first_order_anniversary, and
customer date / date-time metafields. On a plain date attribute such as
last_order_date they are rejected at validation; use a BETWEEN range or an
IN LAST window instead.
Complex attributes and MATCHES
Complex attributes (orders_placed, products_purchased,
storefront.product_viewed, and so on) represent a set of records per
customer - orders, order lines, events. You query them with MATCHES:
orders_placed MATCHES (count >= 3, sum_amount > 10000)- Sub-conditions are separated by commas, which mean AND.
- Record-level subfields (
date,channel,sku, …) filter which records count. Aggregate subfields (count,sum_amount,avg_rating, …) are computed over the records that pass those filters. MATCHES ()with no sub-conditions means “has at least one record”.NOT_MATCHES (...)means “has no record matching these sub-conditions”.IS NULLon the parent means the customer has never had such a record (never placed an order, never abandoned a checkout);IS NOT NULLmeans they have at least one, ever.
Subfields are only valid inside their parent’s MATCHES (...) - you can’t
write orders_placed.count at the top level.
Taxonomy categories
The category attributes (products_purchased.category,
storefront.product_viewed.category) take a product taxonomy category key
such as aa-1-13. Matching is hierarchical: a condition on a category
also matches every descendant category, so category = 'aa-1' (Clothing)
matches products in any clothing subcategory. IS NULL matches uncategorized
products.
Customer profile
Basic identity, account, and lifecycle facts about the customer record.
| Attribute | Type | Operators | Notes |
|---|---|---|---|
customer.email | text | String | Customer email address. |
customer.phone | text | String | Customer phone number. |
customer.first_name | text | String | |
customer.last_name | text | String | |
customer_account_status | enum | Enum | ENABLED, DISABLED, INVITED, DECLINED. |
customer_added_date | date | Date | Date the customer record was created. |
customer.email_verified_at | date | Date | Empty until the email is verified. |
customer.phone_verified_at | date | Date | Empty until the phone is verified. |
customer_email_domain | text | String | Domain part of the email, e.g. gmail.com. = and IN match case-insensitively; the editor suggests the domains your customers actually use. |
customer_tags | tag list | Tag | Tags on the customer profile. |
customer.tax_exempt | boolean | Boolean | |
customer_language | text | String | Preferred language/locale. |
customer.login_channel | enum | Enum | email, sms. |
customer.last_login_at | datetime | Date | |
customer.is_guest | boolean | Boolean | True when the customer has no verified email or phone. |
customer.has_verified_email | boolean | Boolean | |
customer.has_verified_phone | boolean | Boolean | |
customer.account_anniversary | recurring date | Recurring date | Yearly anniversary of the signup date. |
customer.first_order_anniversary | recurring date | Recurring date | Yearly anniversary of the first order. |
customer.birthday | recurring date | Recurring date | Recurring month/day, evaluated in the store timezone. |
customer.is_walkin | boolean | Boolean | POS walk-in record with no contact details. Sellerlane-only. |
customer.is_b2b_buyer | boolean | Boolean | The customer holds an active company (wholesale) membership. |
company.id | enum | Enum | The company the customer is an active member of. Open enum - the picker lists at most 250 companies. |
company.name | enum | Enum | Name spelling of the same membership. Open enum. |
customer_tags CONTAINS 'vip' AND customer.has_verified_email = trueAND customer.birthday IN NEXT 7 DAYSLocation
Location attributes match against any of the customer’s saved addresses. For radius targeting, see Geo distance.
| Attribute | Type | Operators | Notes |
|---|---|---|---|
customer_countries | text | String | ISO country code across the customer’s addresses, e.g. IN. |
customer_regions | text | String | States/provinces, stored as a country-region composite, e.g. in-tn. |
customer_cities | text | String | Cities, stored as a country-region-city composite with punctuation stripped, e.g. in-tn-chennai. |
customer.postal_code | text | String | Postal codes across the customer’s addresses. |
Region and city values are composites, not the plain names - a city is
matched as in-tn-chennai, never as Chennai. You don’t have to construct
them: all four attributes suggest values from your store’s own addresses, and
the dropdown shows the readable label (Chennai, TN, IN) while inserting the
composite the query needs. See
value suggestions.
customer_countries = 'IN' AND customer_cities IN ('in-mh-mumbai', 'in-mh-pune')Spending & order stats
Lifetime aggregates over the customer’s order history. Money values are major currency units.
| Attribute | Type | Operators | Notes |
|---|---|---|---|
amount_spent | money | Money | Customer-profile spend across paid-ish, uncanceled orders after raw payment refunds. Includes tax, shipping, and money paid to purchase a gift card; it is not analytics Total sales. |
number_of_orders | number | Number | Count of the same paid-ish, uncanceled, non-test customer-profile orders. |
average_order_value | money | Money | Average customer-profile spend per paid order (amount_spent ÷ number_of_orders). Despite the stable query key, this is not the analytics Average order value metric. |
first_order_date | date | Date | Empty for customers who have never ordered. |
last_order_date | date | Date | Empty for customers who have never ordered. |
amount_spent > 500 AND number_of_orders >= 3AND last_order_date NOT IN LAST 90 DAYSThe editor labels average_order_value as Average spend per paid order to
avoid confusing it with analytics AOV. Analytics AOV is order-time merchandise
after discounts divided by eligible non-gift-card orders and deliberately
excludes tax, shipping, gift-card issuance, and later refunds. See
Financial semantics.
Predictions & RFM
Recency/frequency/monetary scoring from the latest analytics snapshot, plus spend predictions. The three prediction attributes only appear in the editor once your store has more than 100 qualifying orders and a generated prediction snapshot. RFM is lifetime-scoped: chronology uses eligible order placement, while monetary value uses event-net total sales through the snapshot. See RFM and actual lifetime value.
| Attribute | Type | Operators | Notes |
|---|---|---|---|
rfm_group | enum | Enum | DORMANT, AT_RISK, PREVIOUSLY_LOYAL, NEEDS_ATTENTION, ALMOST_LOST, LOYAL, PROMISING, ACTIVE, NEW, CHAMPIONS, PROSPECTS. |
rfm.recency_days | number | Number | Store-local days since the latest eligible order was placed. |
rfm.frequency | number | Number | Lifetime eligible orders placed through the snapshot. |
rfm.monetary | money | Money | Lifetime event-net total sales through the snapshot, floored at zero per customer. |
rfm.r_score | number | Number | Recency score. |
rfm.f_score | number | Number | Frequency score. |
rfm.m_score | number | Number | Monetary score. |
rfm.fm_score | number | Number | Combined frequency-monetary score. |
rfm.rfm_score | text | String | Combined score string, e.g. 543. |
rfm.first_order_date | date | Date | First order date in the snapshot. |
rfm.last_order_date | date | Date | Last order date in the snapshot. |
predicted_spend_tier | enum | Enum | HIGH, MEDIUM, LOW. |
predicted_ltv | money | Money | Predicted lifetime value. Sellerlane-only. |
prediction_confidence | number | Number | Model confidence, 0 to 1. Sellerlane-only. |
rfm_group IN ('CHAMPIONS', 'LOYAL') OR predicted_spend_tier = 'HIGH'Marketing consent
Email marketing consent and tracking preferences. See the consent guide for what each state means.
| Attribute | Type | Operators | Notes |
|---|---|---|---|
email_subscription_status | enum | Enum | SUBSCRIBED, UNSUBSCRIBED, NOT_SUBSCRIBED, PENDING, INVALID, REDACTED. |
customer.email_can_receive_marketing | boolean | Boolean | The effective “may I email this person” flag. |
customer.email_open_tracking_allowed | boolean | Boolean | |
customer.email_click_tracking_allowed | boolean | Boolean | |
customer.marketing_consent_updated_at | datetime | Date | When consent last changed. |
email_subscription_status = 'SUBSCRIBED'AND customer.marketing_consent_updated_at > -30dOrders placed
orders_placed is a complex attribute over the customer’s orders. Use
MATCHES with the subfields below; orders_placed IS NULL means the
customer has never placed an order.
| Subfield | Type | Operators | Notes |
|---|---|---|---|
date | date | Date | Order creation date. |
paid_date | date | Date | |
canceled_date | date | Date | |
closed_date | date | Date | |
count | number | Number | Number of matched orders. |
amount | money | Money | A single matched order’s total. |
sum_amount | money | Money | Sum of matched order totals. |
sum_net_sales | money | Money | |
sum_gross_sales | money | Money | |
sum_discount | money | Money | |
sum_refund | money | Money | |
average_order_amount | money | Money | Average across matched orders. |
min_order_amount | money | Money | |
max_order_amount | money | Money | |
location_id | ID | ID | POS/store location of the order. |
channel | enum | Enum | online, pos. |
financial_status | enum | Enum | pending, authorized, partially_paid, paid, partially_refunded, refunded, voided. |
fulfillment_status | enum | Enum | unfulfilled, partially_fulfilled, fulfilled. |
lifecycle_status | enum | Enum | open, closed, canceled. |
shipping_country | enum | Enum | ISO country code, free input. |
shipping_region | text | String | |
shipping_city | text | String | |
billing_country | enum | Enum | ISO country code, free input. |
billing_region | text | String | |
billing_city | text | String | |
used_store_credit | boolean | Boolean | |
store_credit_amount | money | Money | Store credit applied to the order. |
used_gift_card | boolean | Boolean | |
gift_card_amount | money | Money | Gift card amount applied to the order. |
is_first_order | boolean | Boolean | True on the customer’s first order. |
customer_order_index | number | Number | Order sequence number for the customer (1 = first). |
payment_method_kind | enum | Enum | gateway, manual. Sellerlane-only. |
gateway_provider | enum | Enum | stripe, razorpay, payu, adyen, xendit, paystack, mercadopago, tap, twoctwop, flutterwave, airwallex, cashfree. Sellerlane-only. |
payment_amount_type | enum | Enum | Payment rule applied at checkout: full, percentage, fixed (deposits), cod. Sellerlane-only. |
is_cod | boolean | Boolean | Cash on delivery. Sellerlane-only. |
has_discount | boolean | Boolean | Any discount applied. |
discount_code | text | String | Discount code used on the order. |
has_refund | boolean | Boolean | |
has_return | boolean | Boolean | Returned units or return value exist. |
units_returned | number | Number | |
metafield.<namespace>.<key> | metafield | By value type | Order metafield condition - see Custom fields. |
orders_placed MATCHES (count >= 3, sum_amount > 10000, date IN LAST 6 MONTHS)AND orders_placed NOT_MATCHES (is_cod = true, has_return = true)Products purchased
Three complex attributes cover the line-item view of order history:
products_purchased (by product), ordered_variant (by variant), and
ordered_collection (by collection membership of purchased products).
products_purchased IS NULL means the customer has never bought anything.
products_purchased
| Subfield | Type | Operators | Notes |
|---|---|---|---|
date | date | Date | Order date of the matched line. |
count | number | Number | Number of matched order lines. |
quantity | number | Number | Quantity on a single matched line. |
sum_quantity | number | Number | Total quantity across matched lines. |
sum_line_amount | money | Money | Total net sales from matched lines. |
id | ID | ID | The purchased product. |
variant_id | ID | ID | The purchased variant. |
sku | text | String | |
vendor | text | String | |
product_type | text | String | The merchant-defined product type label. |
tag | tag list | Tag | Product tags at order time. |
category | category | Category | Taxonomy category, includes all subcategories. |
product_kind | enum | Enum | Platform kind: physical, digital, gift_card, event, bundle. Sellerlane-only. |
brand_id | ID | ID | |
metafield.<namespace>.<key> | metafield | By value type | Product metafield condition. |
ordered_variant
| Subfield | Type | Operators | Notes |
|---|---|---|---|
date | date | Date | |
count | number | Number | Number of matched lines. |
quantity | number | Number | Total purchased quantity. |
sum_line_amount | money | Money | |
variant_id | ID | ID | |
product_id | ID | ID | Parent product. |
sku | text | String | |
metafield.<namespace>.<key> | metafield | By value type | Variant metafield condition. |
ordered_collection
| Subfield | Type | Operators | Notes |
|---|---|---|---|
date | date | Date | |
count | number | Number | Matched lines whose product is in the collection. |
collection_id | ID | ID | |
metafield.<namespace>.<key> | metafield | By value type | Collection metafield condition. |
products_purchased MATCHES (category = 'aa-1-13', date IN LAST 90 DAYS)OR ordered_variant MATCHES (sku STARTS WITH 'TSHIRT-')Abandoned checkout
One scalar plus the abandoned_checkout complex attribute over the
customer’s abandoned carts/checkouts.
| Attribute | Type | Operators | Notes |
|---|---|---|---|
abandoned_checkout_date | date | Date | Date of the customer’s abandoned checkout. |
abandoned_checkout | complex | Complex | Subfields below. |
| Subfield | Type | Operators | Notes |
|---|---|---|---|
date | date | Date | When the cart was abandoned. |
count | number | Number | Number of abandoned checkouts. |
amount | money | Money | Cart total. |
line_count | number | Number | Lines in the cart. |
item_quantity | number | Number | Items in the cart. |
channel | enum | Enum | online, pos. |
recovered | boolean | Boolean | Whether the checkout later converted to an order. |
recovered_date | date | Date | |
used_store_credit | boolean | Boolean | |
store_credit_amount | money | Money | |
used_gift_card | boolean | Boolean | |
gift_card_amount | money | Money |
abandoned_checkout MATCHES (date IN LAST 7 DAYS, recovered = false, amount > 1000)Store credit
store_credit_accounts matches on the customer’s store credit account state.
store_credit_accounts IS NULL means the customer has never had a store
credit account.
| Subfield | Type | Operators | Notes |
|---|---|---|---|
balance | money | Money | Current balance. |
currency | enum | Enum | ISO currency code, free input. |
expiring_amount | money | Money | Portion of the balance that has an expiry date. |
next_expiry_date | date | Date | |
last_credit_date | date | Date | Last time credit was issued. |
last_debit_date | date | Date | Last time credit was spent. |
issued_amount | money | Money | Lifetime credit issued. |
redeemed_amount | money | Money | Lifetime credit redeemed. |
expired_amount | money | Money | Lifetime credit expired. |
ledger_count | number | Number | Ledger entries on the account. |
store_credit_accounts MATCHES (balance > 0, next_expiry_date IN NEXT 30 DAYS)Gift cards
Sellerlane-only. gift_cards matches on gift cards assigned to the
customer (cards they hold and can spend), plus one purchase-side boolean.
| Attribute | Type | Operators | Notes |
|---|---|---|---|
gift_cards | complex | Complex | Subfields below. |
customer.has_purchased_gift_card | boolean | Boolean | The customer has bought a gift card, for themselves or as a gift. |
| Subfield | Type | Operators | Notes |
|---|---|---|---|
balance | money | Money | Remaining spendable balance across active, unexpired cards (net of checkout reservations). |
count | number | Number | Number of matched cards. |
state | enum | Enum | active, disabled, expired. |
expiry_date | date | Date | IN NEXT 30 DAYS makes an expiring-soon winback. |
last_used_date | date | Date | Last redemption against an order. |
gift_cards MATCHES (state = 'active', expiry_date IN NEXT 30 DAYS)Loyalty
Sellerlane-only. loyalty matches on the customer’s loyalty account.
loyalty IS NULL means the customer has never had a loyalty account.
| Subfield | Type | Operators | Notes |
|---|---|---|---|
points_balance | number | Number | Current redeemable points. |
tier | enum | Enum | Your store’s tier names. An open enum: the editor offers your current tiers, and a value outside that list still compiles (with a warning), so a segment survives a tier rename. |
status | enum | Enum | enrolled, paused, excluded, merged. |
enrolled_at | date | Date | |
last_earned_at | date | Date | |
last_redeemed_at | date | Date | |
lifetime_earned_points | number | Number | |
lifetime_redeemed_points | number | Number | |
next_expiration_date | date | Date | Next points expiry - good for expiring-points winbacks. |
loyalty MATCHES (status = 'enrolled', points_balance >= 500, next_expiration_date IN NEXT 14 DAYS)Reviews
Sellerlane-only. product_review matches on reviews the customer has
submitted.
| Subfield | Type | Operators | Notes |
|---|---|---|---|
date | date | Date | When the review was submitted. |
count | number | Number | Number of matched reviews. |
rating | number | Number | Star rating on a matched review (1-5). |
avg_rating | number | Number | Average rating across matched reviews. |
verified | boolean | Boolean | Verified purchase. |
has_photo | boolean | Boolean | Review includes a visible photo. |
has_video | boolean | Boolean | Review includes a visible video. |
product_id | ID | ID | The reviewed product. |
product_review MATCHES (rating >= 4, has_photo = true, date IN LAST 12 MONTHS)Referrals
Sellerlane-only. referrals_made matches referrals where the customer is
the referrer; customer.was_referred covers the other direction.
| Attribute | Type | Operators | Notes |
|---|---|---|---|
referrals_made | complex | Complex | Subfields below. |
customer.was_referred | boolean | Boolean | The customer joined through someone else’s referral. |
| Subfield | Type | Operators | Notes |
|---|---|---|---|
date | date | Date | When the referral was attributed. |
count | number | Number | Number of matched referrals. |
status | enum | Enum | pending, qualified, rewarded, disqualified. |
referrals_made MATCHES (status = 'rewarded') AND customer.was_referred = falseEvent tickets
Sellerlane-only. event_tickets matches ticket reservations from the
customer’s orders for event products.
| Subfield | Type | Operators | Notes |
|---|---|---|---|
start_date | date | Date | Event start. IN NEXT finds upcoming attendees; IN LAST is a past-attendance proxy. |
product_id | ID | ID | The event product. |
quantity | number | Number | Tickets on a matched reservation. |
canceled | boolean | Boolean | Reservation was canceled. |
count | number | Number | Number of matched reservations. |
event_tickets MATCHES (start_date IN NEXT 30 DAYS, canceled = false)Back-in-stock requests
Sellerlane-only. stock_notifications matches the customer’s
back-in-stock requests. Only signed-in requests can match - guest email-only
requests have no customer record.
| Subfield | Type | Operators | Notes |
|---|---|---|---|
product_id | ID | ID | Product the customer is waiting on. |
variant_id | ID | ID | Variant the customer is waiting on. |
status | enum | Enum | active, notified, canceled, expired. |
date | date | Date | When the request was made. |
count | number | Number | Number of matched requests. |
stock_notifications MATCHES (status = 'active', date IN LAST 30 DAYS)Self-service requests
Sellerlane-only. self_service_requests matches the customer’s buyer
self-service requests (cancellations, returns, redeliveries, and so on).
| Subfield | Type | Operators | Notes |
|---|---|---|---|
type | enum | Enum | order_cancel, return, event_reschedule, event_cancel, digital_redeliver, digital_redownload, gift_card_resend. |
status | enum | Enum | requested, approved, in_transit, received, completed, declined, withdrawn, expired. |
date | date | Date | When the request was submitted. |
count | number | Number | Number of matched requests. |
self_service_requests MATCHES (type = 'return', status = 'completed', date IN LAST 6 MONTHS)Email engagement
Eight complex attributes, one per email event. All share the same subfields;
email.clicked adds a click-specific one. IS NULL on any of them
means the event has never happened for the customer. The older
shopify_email.* spelling is a legacy alias — saved segments using it keep
validating, but new queries should use email.*.
| Attribute | Meaning |
|---|---|
email.sent | A marketing email was sent. |
email.delivered | An email was delivered. |
email.opened | An email was opened. |
email.clicked | A link in an email was clicked. |
email.bounced | An email bounced. |
email.failed | An email failed to send. |
email.unsubscribed | The customer unsubscribed from an email. |
email.marked_as_spam | The customer reported an email as spam. |
| Subfield | Type | Operators | Notes |
|---|---|---|---|
date | date | Date | When the event happened. |
count | number | Number | Number of matched events. |
campaign_id | ID | ID | The campaign. |
activity_id | ID | ID | The activity: a campaign or one specific standalone/automation email — matching either id. The editor suggests both, emails shown by subject. |
link_url | text | String | Clicked link URL. email.clicked only; the editor suggests URLs that have actually been clicked. |
email.delivered MATCHES (date IN LAST 90 DAYS)AND email.opened IS NULLStorefront behavior
Thirteen complex attributes over the customer’s storefront analytics events. Events only attribute to a customer when the visit is identified (logged in or recognized), and consent settings apply.
| Attribute | Event |
|---|---|
storefront.product_viewed | Viewed a product page. |
storefront.collection_viewed | Viewed a collection page. |
page_viewed | Viewed any storefront page. |
product_added_to_cart | Added a product to the cart. |
product_removed_from_cart | Removed a product from the cart. |
cart_viewed | Viewed the cart. |
checkout_started | Started checkout. |
checkout_completed | Completed checkout. |
search_submitted | Submitted a storefront search. |
discount_code_entered | Entered a discount code. |
discount_code_applied | A discount code was applied. |
discount_code_rejected | A discount code was rejected. |
payment_failed | A payment attempt failed. |
All thirteen share these subfields - and the nine generic events have only these:
| Subfield | Type | Operators | Notes |
|---|---|---|---|
date | date | Date | Event date. |
count | number | Number | Number of matched events. |
path | text | String | Storefront path, e.g. /collections/sale. The editor suggests paths from recent traffic. |
campaign_id | text | String | Free-text client tracking value from the visit’s utm_campaign-style parameters. Not a marketing campaign ID - for that, use the email engagement attributes. |
message_id | text | String | Free-text client tracking value from the visit’s tracking parameters, on the same footing as campaign_id. |
value_amount | money | Money | Event value, where applicable. |
The three product-context events (storefront.product_viewed,
product_added_to_cart, product_removed_from_cart) additionally support:
| Subfield | Type | Operators | Notes |
|---|---|---|---|
id | ID | ID | The product. |
variant_id | ID | ID | The variant. |
tag | tag list | Tag | The product’s current tags. |
category | category | Category | The product’s current taxonomy category, includes all subcategories. |
metafield.<namespace>.<key> | metafield | By value type | Product metafield condition. |
storefront.collection_viewed additionally supports id (the collection)
and metafield.<namespace>.<key> (collection metafield).
Those extras are scoped to the events that have them. The product
parameters exist only on the three product events, the collection parameters
only on storefront.collection_viewed, and the remaining nine events
(page_viewed, cart_viewed, checkout_started, checkout_completed,
search_submitted, the three discount_code_* events, and payment_failed)
accept nothing beyond the six shared subfields. Writing
checkout_completed MATCHES (id = '…') is an error you see while typing, not
a condition that quietly matches nobody.
There are no search_query or discount_code subfields: the analytics
pipeline doesn’t store the raw query or code, so those can’t be filtered on.
storefront.product_viewed MATCHES (category = 'aa-1-13', date IN LAST 14 DAYS)AND products_purchased IS NULLGeo distance
customer_within_distance matches customers whose identified storefront
visit places them within a radius of a coordinate. It uses a MATCHES form
with fixed parameters rather than subfields:
customer_within_distance MATCHES (coordinates = (13.08, 80.27), distance_km = 25)Use distance_km or distance_mi. Latitude runs -90 to 90, longitude -180
to 180, and the distance must be positive. IS NULL / IS NOT NULL match
customers with no known / any known visit location.
Custom fields (metafields)
Any metafield definition with Use as filter enabled becomes a segment attribute, as long as its value type is filterable. Where it appears depends on the owner type:
| Owner type | Where you use it | Written as |
|---|---|---|
| Customer | Top level | metafields.<namespace>.<key> |
| Order | Inside orders_placed MATCHES (...) | metafield.<namespace>.<key> |
| Product | Inside products_purchased, storefront.product_viewed, product_added_to_cart, product_removed_from_cart | metafield.<namespace>.<key> |
| Variant | Inside ordered_variant MATCHES (...) | metafield.<namespace>.<key> |
| Collection | Inside ordered_collection, storefront.collection_viewed | metafield.<namespace>.<key> |
Note the spelling difference: plural metafields. at the top level, singular
metafield. inside a MATCHES.
Value types and operators
The metafield’s value type decides the operator set:
| Value type | Operators | Notes |
|---|---|---|
| Single-line text, multi-line text, URL | String | = and IN are case-sensitive for text metafields. |
| Color | String | Compared case-insensitively. |
| Integer, decimal, rating | Number | Rating comparisons are checked against the definition’s min/max scale. |
| Money | Money | Major currency units. |
| Date, date-time | Date | Customer date metafields also support the recurring operators IN MONTH and ON <month day> - ideal for birthdays and renewal dates. |
| Boolean | Boolean | |
| Dimension, volume, weight | Number + unit | Write the unit after the value: metafield.specs.weight > 2 kg. Units - dimension: mm, cm, m, in, ft, yd; volume: ml, cl, l, m3, us_fl_oz, us_pt, us_qt, us_gal, imp_fl_oz, imp_pt, imp_qt, imp_gal; weight: g, kg, lb, oz. Comparison is unit-normalized, so 2 kg matches a value stored as 2000 g. |
| References (product, variant, collection, customer, page, blog post, location, file, metaobject) | ID | Compare by referenced ID. |
| JSON, rich text, link | Not filterable | These types never appear in the segment editor. |
List metafields
List metafields compare at the owner level - the condition looks at the whole list:
=,CONTAINS, and other positive operators match when any element matches.- Negative operators (
!=,NOT CONTAINS,NOT IN) match only when no element matches. - Text and number lists additionally offer
CONTAINS ANY (...)(at least one of the given values is an element) andCONTAINS ALL (...)(every given value is an element), like tags.
When a definition is deleted
If you delete a metafield definition that segments reference, Sellerlane removes those conditions from the affected segments automatically, refreshes their membership, and records a note on each segment naming the deleted field. A segment whose rules end up empty matches no one until you edit it. The note clears the next time you save the segment’s rules.
metafields.custom.fit_preference = 'slim'AND orders_placed MATCHES (metafield.custom.gift_wrap = true)See also
- Segment query language - grammar, grouping, and editor behavior.
- Customers & segments - building, previewing, exporting, and using segments.
- Metafields - defining the custom fields you segment on.