Target Expression Reference

Last Updated: 26/8/2026     Tags: target expressions, target, expression, reference, purchased
  • Switch Version
  • V5
  • V4

Target expressions select subscribers using profile data, membership, recorded events and combinations of those conditions. Keywords are lowercase in the examples below. Use parentheses to make compound expressions unambiguous.

Token definitions

Token Description
field A subscriber field, list-option value or custom-field key. A field can be cast with ::date, ::real or ::integer.
integer A whole number, such as 1.
real A decimal number, such as 0.2.
percentage A percentage, such as 80%.
string A value in single or double quotes, such as 'VIC' or "VIC".
null The database null value.
range A value described under Date ranges.
count A count comparison described under Count constraints.
event One of the past-interaction events described under Event predicates.
tracked event One of the custom tracking events described under Custom tracked-event predicates.
channel A messaging or interaction channel, such as email or sms.

Syntax conventions

  • Words outside square brackets are literal keywords.
  • Values in square brackets are operands to replace, such as [integer] or [range].
  • A comma followed by an ellipsis means that the operand can be repeated, such as [integer, ...].
  • Operands are shown in the exact order accepted by the parser.
  • A range or count is optional only when it appears in square brackets.
  • Count modifiers are available only on predicates whose syntax explicitly includes [count].
  • Singular and plural forms are shown separately where both are supported.

Field predicates

Use a subscriber field, an operator and a value:

[field] [operator] [integer|real|string|null]

Examples:

state = 'VIC'
postcode one of '2000, 2001, 2002, 2003'
predicted_lifetime_value > 50
total_conversion_value < 100
email ilike '%@example.com'

A date range can be the value of is or is not:

dob is 20-30 years ago
renewal_date::date is next 30 days

Casting and field values

Cast Purpose
::real Interpret the field as a number that may contain a fractional part.
::integer Interpret the field as a whole number.
::date Interpret the field as a date.

Examples:

total::real > 100
quantity::integer >= 2
renewal_date::date is next 30 days

Explicit custom fields use the cf: prefix:

cf:plan = 'premium'

Quote a field name when it contains spaces:

'cf:custom field' = 'value'

String values can use single or double quotes. Escape a quote or backslash when it must be included inside the string.

Cluster keyword predicate

Use cluster_id to target subscribers associated with one or more Taguchi cluster keywords:

cluster_id = [integer]
cluster_id one of [string]

Examples:

cluster_id = 12
cluster_id one of '12, 24, 31'

Cluster IDs are numeric values configured in Settings > Tags.

POSIX regular-expression operators

Operator Description
~ Case-sensitive match.
!~ Case-sensitive non-match.
~* Case-insensitive match.
!~* Case-insensitive non-match.

Examples:

phone ~ '^\\+\\d{1,15}$'
'cf:custom field' ~ '^\\d{12}$'
email ~ '^\\w+@\\w+\\.\\w+$'
date ~ '^\\d{2}/\\d{2}/\\d{4}$'

Backslashes inside quoted expression strings must be escaped. The examples therefore use \\ where the regular expression passed to the matcher needs \.

List predicates

subscribed list [integer] [range]
subscribed lists [integer, ...] [range]
unsubscribed list [integer] [range]
unsubscribed lists [integer, ...] [range]

Examples:

subscribed list 18
subscribed lists 18, 22, 49
unsubscribed lists 10, 20 this week
subscribed list 123 source "Website"

List predicates can include event-field criteria, an optional source list and a date range. A quoted option can also follow a list ID when matching a subscription option. The available fields and source values depend on the data recorded by the organisation.

Count modifiers are not supported on list predicates because [count] is not part of their accepted syntax.

Audience predicates

Current membership

in audience [integer]
in audiences [integer, ...]

Examples:

in audience 12
in audiences 12, 14

Membership history

joined audience [integer] [range]
joined audiences [integer, ...] [range]
left audience [integer] [range]
left audiences [integer, ...] [range]

Examples:

joined audience 12 last 30 days
joined audiences 12, 14 this month
left audience 12 last year

Audiences provide reusable segmentation and are updated daily. See Audiences for configuration guidance.

Count modifiers are not supported on current-membership or audience-history predicates because [count] is not part of their accepted syntax.

Event predicates

Use a recorded event with an activity, campaign, revision, configuration or asset:

[event] [resource] [integer, ...] [range] [count]

Events

The complete event vocabulary is:

Event Typical meaning
sent A communication was sent.
clicked A tracked link was clicked.
opened A communication was opened.
subscribed A subscription event occurred.
unsubscribed An unsubscribe event occurred.
updated An update event occurred.
forwarded A forward event occurred.
replied A reply event occurred.
viewed A view event occurred.
entered An entry event occurred.
referred A referral event occurred.
converted A conversion event occurred.
bounced A bounce event occurred.
liked A like event occurred.
abandoned An abandonment event occurred.
complained A complaint event occurred.
control-group A control-group event occurred.

The available resource types are:

activity | activities
campaign | campaigns
revision | revisions
configuration | configurations
asset | assets

Not every resource/event combination necessarily has recorded data. A predicate only returns subscribers when the corresponding event exists.

Activity examples

sent activity 10
opened activities 10, 20 last 30 days
clicked activity 10 count>=2
bounced activity 10
complained activity 10 last 90 days
forwarded activity 10
replied activity 10
converted activity 10
control-group activity 10

Campaign examples

sent campaign 10
opened campaigns 10, 20 last 30 days
clicked campaign 10 count>=2
bounced campaign 10
converted campaigns 10, 20

Revision and configuration examples

sent revision 100
opened revisions 100, 101 last 30 days
bounced revision 100
sent configuration 200
clicked configurations 200, 201 last 30 days
converted configuration 200

Any-resource predicates

Use any to match an event without specifying resource IDs:

[event] any [range] [count]

Examples:

sent any last 30 days
clicked any last 30 days
opened any last 30 days count>=2
bounced any last year
complained any last 90 days
converted any all time

any is followed directly by an optional date range and count. It does not take an integer resource ID.

Activity-type predicates

Events can be restricted directly to an activity type:

[event] [activity type] [range] [count]

Supported activity types are:

email
sms
whatsapp
web
displayad
line
pushnotification
iam

Examples:

opened email last 30 days
clicked email last 30 days count>=2
sent sms last 7 days
replied sms last 30 days
viewed web last 30 days
converted displayad last 90 days
opened pushnotification last 30 days
complained email all time
bounced email last 30 days

Asset engagement predicates

Target subscribers based on whether they clicked links inside specific asset content blocks, using this asset resource type.

Use the asset ID and not its name when targeting.

[event] asset [integer] [range] [count]
[event] assets [integer, ...] [range] [count]

Examples:

sent asset 300
clicked asset 300
opened asset 300
viewed asset 300
converted asset 300
bounced asset 300
complained asset 300
clicked assets 300, 301 last 30 days
viewed assets 300, 301 count>=2

Asset predicates accept the complete event vocabulary: sent, clicked, opened, subscribed, unsubscribed, updated, forwarded, replied, viewed, entered, referred, converted, bounced, liked, abandoned, complained and control-group.

Not every event is meaningful for every asset. An asset predicate only returns subscribers when that event was recorded against the specified content block.

clicked link [string] [range] [count]
clicked links [string, ...] [range] [count]
clicked link starts with [string] [range] [count]

Examples covering the simple, date-range and count forms:

clicked link 'https://example.org/'
clicked links 'https://example.org/1', 'https://example.org/2'
clicked link starts with 'https://example.org/products/'
clicked link 'https://example.org/' last 30 days count>=2

Restrict a link predicate to one or more activities:

clicked link 'https://example.org/' activity 1
clicked links 'https://example.org/1', 'https://example.org/2' activities 1, 2
clicked link starts with 'https://example.org/products/' activities 1, 2 last 30 days

The activity-first form is also supported:

clicked activity link 1 'https://example.org/'
clicked activity links 1 'https://example.org/1', 'https://example.org/2'
clicked activities links 1, 2 'https://example.org/'

Purchase predicates

purchased [field criteria] [range] [count]

Examples:

purchased last 12 months
purchased count>=5
purchased id = '50'
purchased total::real > 100 last 12 months
purchased category like 'Appliances/%'
purchased category like 'Toys/%', price::real > 15 last 7 days
purchased 2026-04-13 to 2026-04-16

Multiple field criteria are comma-separated and apply to the same recorded purchase.

Visit predicates

visited [field criteria] [range] [count]

Examples:

visited last 12 months
visited count>=2
visited url = 'https://example.com'
visited url like 'https://example.com/sales/%' last 12 months

Custom tracked-event predicates

Custom tracking uses the separate tracked predicate:

tracked [tracked event] [field criteria] [range] [count]

The complete tracked-event vocabulary is:

Tracked event Example
open tracked open last 30 days
view tracked view last 12 months
abandon tracked abandon last 7 days
submit tracked submit last 30 days
update tracked update last 30 days
enter tracked enter last 30 days
unsubscribe tracked unsubscribe last 90 days
bounce tracked bounce all time

Tracked predicates can include recorded event fields and counts:

tracked update UserType = 'premium'
tracked open AppPage like 'products/%' last 12 months
tracked submit form_id = 'contact-us' last 30 days
tracked bounce reason ilike '%mailbox%' last 90 days
tracked open count>=2
tracked bounce last 90 days count>=2

bounced activity 10 and tracked bounce are different predicates:

  • bounced activity 10 matches a resource history event associated with activity 10.
  • tracked bounce matches a custom tracking event whose event type is bounce.

Birthday predicate

birthday [range]

Examples:

birthday this month
birthday next 3 days
birthday in 7 days

View predicate

match view [integer]
match views [integer, ...]
match view [integer] with [string]

Examples:

match views 5, 10
match view 1 with 'example'

Count and date-range modifiers are not supported on view predicates because they are not part of the accepted syntax.

Contactable predicate

contactable via [channel]

Examples:

contactable via email
contactable via sms

When an activity is deployed, Taguchi applies an implicit contactability condition for its channel. A raw target-expression estimate can therefore be higher than the final sendable audience unless the equivalent contactability predicate is included in the estimate.

Channel-engagement predicates

Match a channel event in a date range:

channel [channel] [channel event] [range]

Or compare a channel metric:

channel [channel] [channel event] count [operator] [number]
channel [channel] [channel event] rate [operator] [number]

Supported channel events are:

send
clicked
opened
viewed
replied
converted
subscribed

Examples:

channel email opened last 30 days
channel email clicked last 30 days
channel sms replied last 90 days
channel email opened count >= 5
channel email opened rate >= 25
channel email clicked rate > 5
channel sms send count >= 3

The availability and interpretation of metrics depend on the channel and the events recorded for the organisation.

Channel metrics require spaces around the comparison operator, as in count >= 5. This differs from an aggregate count modifier, which must be written without spaces, as in count>=5.

Partition predicate

Partition predicates apply field criteria to the subscriber's partition data:

partition [field criteria]

Example:

partition id = 1

The fields and values available for this predicate depend on the organisation's partition configuration. Confirm the appropriate partition field before using the expression in production.

Date ranges

Named ranges

Range Meaning
yesterday Start of yesterday to start of today.
today Start of today to start of tomorrow.
tomorrow Start of tomorrow to start of the following day.
this week Start of the current week to start of the next week.
this month Start of the current month to start of the next month.
this year Start of the current year to start of the next year.
all time No time constraint. This can also be omitted.

Relative ranges

The grammar supports minutes, hours, days, weeks, months and years:

last minute
last hour
last day
last week
last month
last year
last 15 minutes
last 24 hours
last 30 days
last 12 months
next minute
next hour
next day
next week
next month
next year
next 15 minutes
next 24 hours
next 30 days
next 12 months

Future in forms are supported:

in 3 days
in 2 weeks
in 6 months

Banded past and future ranges are supported:

3-6 months ago
7-14 days ago
in 2-4 weeks
in 30-60 days

Single-period ago forms are also supported:

1 minute ago
2 hours ago
3 days ago
4 weeks ago
5 months ago
20 years ago

Exact ranges

2026-01-01 to 2026-02-01
2026-01-01T09:00:00 to 2026-01-01T17:00:00

Exact ranges run from the first timestamp to the second timestamp. Relative ranges are evaluated in the organisation's configured timezone.

Count constraints

count[operator][integer]

Examples:

purchased count>5
opened any count<=2
clicked activity 10 last 30 days count>=3
tracked bounce last 90 days count>=2
viewed asset 300 count>1

Do not put spaces between count, its operator and the integer. For example, use count>=2, not count >= 2.

Supported count operators are =, !=, >, >=, < and <=.

Comparison operators

Operator Meaning
= Equal to.
!= Not equal to.
> Greater than.
< Less than.
>= Greater than or equal to.
<= Less than or equal to.
like Pattern match using SQL-style wildcards.
not like Negated pattern match.
ilike Case-insensitive pattern match.
not ilike Negated case-insensitive pattern match.
is Equality or date-range comparison.
is not Negated equality or date-range comparison.
one of Match one of the values in a comma-separated string.
not one of Exclude the values in a comma-separated string.
~ Case-sensitive POSIX regular-expression match.
!~ Negated case-sensitive regular-expression match.
~* Case-insensitive POSIX regular-expression match.
!~* Negated case-insensitive regular-expression match.
@@ Advanced field comparison operator.
!@@ Negated advanced field comparison operator.

For implementation-specific guidance on @@ and !@@, contact Taguchi Support before using them in production targeting.

Boolean operators

Operation Supported forms
AND and, &&, intersect, &
OR or, union, ||, |
Difference except, -
NOT not, !, ~

Examples:

subscribed list 10 and opened campaign 20
subscribed list 10 or subscribed list 20
opened any last 30 days except clicked any last 30 days
not subscribed list 10

Boolean expressions are evaluated left to right. Use parentheses whenever operators are mixed:

(subscribed list 10 or subscribed list 20) and opened activity 30

Limit/Random Models

A limit or ranking model is a modifier, not a standalone expression. Append it to one predicate atom or to a parenthesised compound expression. Every model accepts either an integer count or a percentage.

Exact modifier syntax Selection behaviour Valid expression example Per-partition form
limit [integer]
limit [percentage]
Randomly selects the specified count or fraction. limit is equivalent to random. subscribed list 10 limit 100 subscribed list 10 limit per partition 100
random [integer]
random [percentage]
Randomly selects the specified count or fraction. subscribed list 10 random 10% subscribed list 10 random per partition 10%
highest value [integer]
highest value [percentage]
Selects subscribers with the highest total historical conversion value. purchased all time highest value 10% purchased all time highest value per partition 100
lowest value [integer]
lowest value [percentage]
Selects subscribers with the lowest total historical conversion value. purchased all time lowest value 10% purchased all time lowest value per partition 100
highest future value [integer]
highest future value [percentage]
Selects subscribers with the highest predicted future value. subscribed list 10 highest future value 50 subscribed list 10 highest future value per partition 50
lowest future value [integer]
lowest future value [percentage]
Selects subscribers with the lowest predicted future value. subscribed list 10 lowest future value 50 subscribed list 10 lowest future value per partition 50
most engaged [integer]
most engaged [percentage]
Selects subscribers with the highest engagement. opened any all time most engaged 50% opened any all time most engaged per partition 50%
least engaged [integer]
least engaged [percentage]
Selects subscribers with the lowest engagement. opened any all time least engaged 50% opened any all time least engaged per partition 50%
most recently purchased [integer]
most recently purchased [percentage]
Selects subscribers whose most recent purchase is newest. purchased all time most recently purchased 100 purchased all time most recently purchased per partition 100
most recently engaged [integer]
most recently engaged [percentage]
Selects subscribers whose most recent engagement is newest. opened any all time most recently engaged 100 opened any all time most recently engaged per partition 100
most frequently purchased [integer]
most frequently purchased [percentage]
Selects subscribers with the highest purchase frequency. purchased all time most frequently purchased 100 purchased all time most frequently purchased per partition 100
most frequently engaged [integer]
most frequently engaged [percentage]
Selects subscribers with the highest engagement frequency. opened any all time most frequently engaged 100 opened any all time most frequently engaged per partition 100

In a per-partition form, per partition must appear after the model name and before the integer or percentage:

[predicate] [model] per partition [integer|percentage]

The requested count or percentage is selected separately within each partition. Ranking models depend on the organisation having the corresponding purchase, value or engagement data.

Parenthesise the complete expression before applying a limit or ranking model to more than one condition:

(subscribed list 18 and opened activity 20) random 10%

Working Examples

Subscribers on list 18 who opened activity 20 but did not click it:

subscribed list 18 and opened activity 20 and not clicked activity 20

Subscribers who engaged with either of two content-block assets and did not bounce:

(clicked assets 300, 301 or viewed assets 300, 301) and not bounced any

Subscribers with a recorded custom bounce event in the last 90 days:

tracked bounce last 90 days

A random 10% of subscribers who joined either audience this month:

(joined audiences 12, 14 this month) random 10%

The 100 highest-value purchasers per partition:

purchased all time highest value per partition 100

Troubleshooting and audience-estimate considerations

The expression reports a syntax error

Check the following:

  • Keywords and operands appear in the order shown in this reference.
  • String values are quoted.
  • Resource operands use numeric IDs rather than names.
  • Aggregate counts have no spaces: use count>=2, not count >= 2.
  • Channel metric comparisons do use spaces: use channel email opened count >= 2.
  • A date range appears before an aggregate count.
  • Mixed Boolean operations are parenthesised.
  • The predicate actually supports the supplied range or count modifier.

The expression parses but returns no subscribers

Confirm that:

  • The referenced list, audience, activity, campaign, revision, configuration, view or asset ID exists.
  • The selected event is recorded for that type of resource.
  • The requested date range contains relevant events.
  • Field names, custom-field keys, casts and values match stored data.
  • The organisation records the relevant purchase, visit, tracking or channel-engagement data.
  • Partition fields and values match the organisation's partition configuration.

Not every resource/event combination is meaningful. For example, an asset expression can parse successfully but return no subscribers if that event has never been attributed to the content block.

The audience estimate is pending or approximate

Target-expression estimates are statistical and may be calculated asynchronously. A newly used predicate can initially show an incomplete result while its estimate is prepared. Retry the same expression after processing completes.

An estimate can include a confidence range and may differ slightly from an exact subscriber count.

The deployed audience is smaller than the estimate

Use the target-expression estimate shown in Taguchi before deploying an activity. Estimates are approximate. For an activity, include the appropriate contactable via predicate when you need the estimate to resemble the final sendable audience more closely.

For example:

subscribed list 18 and contactable via email

Deployment applies the channel's contactability requirements at the top level. Subscribers without a valid channel address, or who are globally unsubscribed or otherwise uncontactable, can therefore be excluded at send time.

A limit applies to the wrong part of an expression

Limits attach to one atom. Parenthesise the full compound expression before the limit:

(subscribed list 18 and opened activity 20) random 10%

Advanced or organisation-specific targeting

If a specialised expression cannot be represented with the documented syntax, contact Taguchi Support for assistance.