Skip to content

Evaluation Spec

Updated: Dec 17, 2025

The main purpose of the evaluation_spec of a rule is to determine the objects upon which the rule should execute its action. The evaluation_type determines the type of evaluation method and has the following options:

Evaluation TypeDescription
SCHEDULEFor Schedule Based Rules
TRIGGERFor Trigger Based Rules

The evaluation_spec contains a filters array, which allows you to further narrow the list of matched objects. For example, you can construct filters on ad, ad set and ad campaign metadata and Insights metrics. All filters are evaluated together using the AND operator.

The filters array contains a list of filter objects. These objects are dictionaries with keys of field, value, and operator:

Filter Object KeysDescription
fieldRequired. Filter field, such as Insights data or metadata
valueRequired. Static filter value for the field
operatorRequired. Logical operator for the field

Each filter has a list of supported logical operators. Here are the logical operators supported in SCHEDULE and TRIGGER rules:

Logical OperatorValue (Example)
GREATER_THANnumeric (100)
LESS_THANnumeric (100)
EQUALnumeric (100)
NOT_EQUALnumeric (100)
IN_RANGEtuple ([100, 200])
NOT_IN_RANGEtuple ([100, 200])
INlist (["1", "2", "3"])
NOT_INlist (["1", "2", "3"])
CONTAINstring ("ABC")
NOT_CONTAINstring ("ABC")
ANYlist ([1, 2, 3])
ALLlist ([1, 2, 3])
NONElist ([1, 2, 3])

The evaluation_spec requires a trigger for the TRIGGER evaluation type. The trigger contains a type and an underlying filter specification. Filter specification can be field, value, and operator.

The trigger dynamically determines whether to evaluate a rule, and you can have only one. See Trigger Based Rules for more information.

The following sections define special filters and general groups of filters that you can use.

Special filters

time_preset

The time_preset filter determines the time period over which Insights metrics are aggregated. Currently, only one time_preset is allowed. It applies to all stats filters in the rule, including the one used for the trigger, if present.

The only supported operator for time_preset is EQUAL, and this is required as long as any Insights filter or trigger is present. Trigger Based Rules only support time presets that include TODAY because it performs real-time evaluation.

Time presets for rules can behave differently from other interfaces. Some of the time presets here include today's data. This is because today's data is critical for rules that run more than once a day. For other interfaces, a preset value of LAST_N_DAYS generally does not include today's data. See the descriptions below for more details.

{
  "field": "time_preset",
  "value": "TODAY",
  "operator": "EQUAL"
}
Time Preset ValuesDescription
LIFETIMELifetime of the object
TODAYThe current day starting from midnight in the ad account's timezone
LAST_2_DAYSYESTERDAY and TODAY
LAST_3_DAYSLast 2 full days and TODAY
LAST_7_DAYSLast 6 full days and TODAY
LAST_14_DAYSLast 13 full days and TODAY
LAST_28_DAYSLast 27 full days and TODAY
LAST_30_DAYSLast 29 full days and TODAY
THIS_MONTHThis month, including TODAY
THIS_WEEK_MON_TODAYThis week using Monday as first day of week, including TODAY
THIS_WEEK_SUN_TODAYThis week using Sunday as first day of week, including TODAY
YESTERDAYThe previous full day, excluding TODAY
LAST_2DLast 2 full days, excluding TODAY
LAST_3DLast 3 full days, excluding TODAY
LAST_7DLast 7 full days, excluding TODAY
LAST_14DLast 14 full days, excluding TODAY
LAST_28DLast 28 full days, excluding TODAY
LAST_30DLast 30 full days, excluding TODAY
LAST_ND_14_8Last 14 days to Last 7 days, for ROAS
LAST_ND_30_8Last 30 days to Last 7 days, for ROAS
LAST_ND_60_8Last 60 days to Last 7 days, for ROAS
LAST_ND_120_8Last 120 days to Last 7 days, for ROAS
LAST_ND_180_8Last 180 days to Last 7 days, for ROAS
LAST_ND_LIFETIME_8Lifetime to Last 7 days, for ROAS
LAST_ND_60_29Last 60 days to Last 28 days, for ROAS
LAST_ND_120_29Last 120 days to Last 28 days, for ROAS
LAST_ND_180_29Last 180 days to Last 28 days, for ROAS
LAST_ND_LIFETIME_29Lifetime to Last 28 days, for ROAS

attribution_window

The attribution_window filter determines the lookback window over which insights metrics are aggregated. For more information, see the Insights documentation on Attribution Windows.

Currently, only one attribution_window is allowed, and it applies to all stats filters in the rule. The only supported operator for attribution_window is EQUAL, and this is only supported by Schedule Based Rules.

Whether specified or not, the only allowed value for the attribution_window is ACCOUNT_DEFAULT.

{
  "field": "attribution_window",
  "value": "ACCOUNT_DEFAULT",
  "operator": "EQUAL"
}
Attribution Window ValuesDescription
ACCOUNT_DEFAULTUse the account level attribution window setting

Metadata filters

With metadata filters, you can filter objects based on the current state of their metadata fields. These also support multi-level filtering, which means you can use prefixes to apply a metadata filter on an object's parent or grandparent. This does not affect other filters. Insights filters still apply to the normal object.

All metadata filters are supported for Scheduled Rules, but only a subset are supported for Trigger Rules.

For instance, if you want a rule that applies to ad sets of ad campaigns whose objective is WEBSITE_CLICKS, you can include two filters:

 "filters" : [
  {
    "field": "entity_type",
    "value": "ADSET",
    "operator": "EQUAL",
  },
  {
    "field": "campaign.objective",
    "value": "WEBSITE_CLICKS",
    "operator": "EQUAL"
  }
]

Metadata filters supported by Trigger Based Rules and Schedule Based Rules

Metadata FieldDescription
idSpecific static objects for which the rule is applied. Supported Prefixes: ad, ad set, ad campaign Supported Values: int, array(int) Supported Operators: EQUAL, IN, NOT_IN
entity_typeThe object level for which the rule is applied. Supported Prefixes: none Supported Values: AD, ADSET, CAMPAIGN Supported Operators: EQUAL
nameName of the object, by partial or complete match. Supported Prefixes: ad, ad set, ad campaign Supported Values: string Supported Operators: EQUAL, CONTAIN, NOT_CONTAIN
adlabel_idsAd label ids of the object. Supported Prefixes: ad, ad set, ad campaign Supported Values: array(int) Supported Operators: ANY, ALL, NONE
objectiveObjective of the ad campaign of the object. Supported Prefixes: ad campaign Supported Values: array(APP_INSTALLS, BRAND_AWARENESS, CONVERSIONS, EVENT_RESPONSES, LINK_CLICKS, ...) Supported Operators: IN, NOT_IN
start_timeStart epoch time of the object. Supported Prefixes: ad set, ad campaign Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN, IN_RANGE, NOT_IN_RANGE
stop_timeStop epoch time of the object. Supported Prefixes: ad set, ad campaign Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN
buying_typeBuying type of the ad campaign of the object. Supported Prefixes: ad campaign Supported Values: array(AUCTION, FIXED_CPM, RESERVED) Supported Operators: IN, NOT_IN
billing_eventBilling event of the ad set of the object. Supported Prefixes: ad set Supported Values: array(APP_INSTALLS, LINK_CLICKS, IMPRESSIONS, ...) Supported Operators: IN, NOT_IN
optimization_goalOptimization goal of the ad set of the object. Supported Prefixes: ad set Supported Values: array(APP_INSTALLS, LINK_CLICKS, IMPRESSIONS, ...) Supported Operators: IN, NOT_IN
is_autobidAutobid status of the ad set of the object. Supported Prefixes: ad set Supported Values: array(bool) Supported Operators: IN, NOT_IN
daily_budgetDaily budget of the ad set of the object. Supported Prefixes: ad set Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN, IN_RANGE, NOT_IN_RANGE
lifetime_budgetLifetime budget of the ad set of the object. Supported Prefixes: ad set Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN, IN_RANGE, NOT_IN_RANGE
spend_capSpend cap of the ad campaign of the object. Supported Prefixes: ad campaign Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN, IN_RANGE, NOT_IN_RANGE
bid_amountBid amount of the object. Supported Prefixes: ad, ad set Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN, IN_RANGE, NOT_IN_RANGE
created_timeCreated epoch time of the object. Supported Prefixes: ad, ad set, ad campaign Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN, IN_RANGE, NOT_IN_RANGE
updated_timeUpdated epoch time of the object. Supported Prefixes: ad, ad set, ad campaign Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN, IN_RANGE, NOT_IN_RANGE

Metadata filters supported only by Schedule Based Rules

Metadata FieldDescription
effective_statusEffective statuses of the object. Supported Prefixes: ad, ad set, ad campaign Supported Values: array(ACTIVE, PAUSED, ADSET_PAUSED, CAMPAIGN_PAUSED, PENDING_REVIEW, ARCHIVED, DELETED, DISAPPROVED, PREAPPROVED, PENDING_BILLING_INFO) Supported Operators: IN, NOT_IN
placement.page_typesPage types for placement of the ad set of the object. Supported Prefixes: ad set Supported Values: array(DESKTOPFEED, HOME, INSTAGRAMSTREAM, INSTAGRAMSTORY, ...) Supported Operators: ANY, ALL, NONE
budget_reset_periodBudget reset period of the ad set of the object. Supported Prefixes: ad set Supported Values: array(DAY, LIFETIME) Supported Operators: IN, NOT_IN
hours_since_creationHours since created_time of the object. Supported Prefixes: ad, ad set, ad campaign Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN, IN_RANGE, NOT_IN_RANGE
estimated_budget_spending_percentageEstimated percentage of your ad set's budget to be spent by the end of its schedule. This uses the same mechanism as our Ad Sets, Budget Rebalancing feature, so it works with any budget type, but requires 10 hours of delivery per day. Supported Prefixes: ad set Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN, IN_RANGE, NOT_IN_RANGE
audience_reached_percentageEstimated percentage of your ad set's reach against its audience size. Supported Prefixes: ad set Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN, IN_RANGE, NOT_IN_RANGE
active_timeSeconds since the object had an effective status of ACTIVE. If the object is not currently ACTIVE, this returns 0. Supported Prefixes: ad, ad set, ad campaign Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN, IN_RANGE, NOT_IN_RANGE
current_timeCurrent epoch time. Supported Prefixes: none Supported Values: int Supported Operators: GREATER_THAN, LESS_THAN, IN_RANGE, NOT_IN_RANGE

entity_type and id

For every rule of evaluation type SCHEDULE or TRIGGER, you must specify either an entity_type or id filter.

When you specify an entity_type filter, you determine a dynamic object level for which to apply the rule. For example, if the entity_type is AD, that rule automatically evaluates every new ad that is added to the ad account. This happens regardless of when you create the rule. By specifying an id filter, the rule only applies to a static list of objects.

When you specify an id filter with no prefix, the object level for which to apply the rule is computed automatically. For example, if you want to apply a rule to ads [123, 456], you only need one filter field id, value [123, 456], and operator IN. In this case, entity_type not required, since you provided an initial static list of objects, and the object level can be computed from those objects.

You can use entity_type and id in conjunction with multi-level filtering. For example, if you want a rule that applies to all ads under some specified ad sets, you can have an entity_type filter of AD and an adset.id filter with the specified ad sets.

By default, if you do not specify an effective_status filter, an effective_status filter is implicitly added when evaluating the rule.

For all execution types that act upon active objects, this default filter has an operator of IN and a value of ['ACTIVE', 'PENDING_REVIEW']. This means the rule only evaluates objects that have or will have active delivery. For execution types that do not act upon active objects (UNPAUSE), this filter is added with an operator of NOT_IN and a value of ['DELETED', 'ARCHIVED']. The default filter is an internal optimization for our execution types.

Insights Filters

Insights filters are evaluated against the current values returned from Insights API for a given time_preset. These filters apply directly to the list or level of objects, and do not support multi-level filtering. All Insights filters support the following operators: GREATER_THAN, LESS_THAN, EQUAL, IN_RANGE, NOT_IN_RANGE.

The units represented here are based on the currency's base in the Marketing API. For example, for USD, the base unit is the cent, which means that a value of 1000 for spent is equivalent to $10.00.

For a description of each of the fields below, see the Insights API docs. All of these filters are supported by Schedule Based Rules.

Below is a list of Insights filters and whether they are supported by Trigger Based Rules:

Insights FieldAllowed for Trigger Based Rules?
mobile_app_purchase_roas (Example)No
website_purchase_roas (Example)No
impressionsYes
unique_impressionsYes
clicksYes
unique_clicksYes
spentYes
resultsYes
cost_perYes
cpcYes
cpmYes
ctrYes
cpaYes
cppYes
reachYes
frequencyYes
leadgenYes
link_ctrYes
cost_per_unique_clickYes
result_rateYes
mobile_app_installYes
cost_per_mobile_app_installYes
app_custom_eventYes
app_custom_event.fb_mobile_achievement_unlockedYes
app_custom_event.fb_mobile_activate_appYes
app_custom_event.fb_mobile_add_payment_infoYes
app_custom_event.fb_mobile_add_to_cartYes
app_custom_event.fb_mobile_add_to_wishlistYes
app_custom_event.fb_mobile_complete_registrationYes
app_custom_event.fb_mobile_content_viewYes
app_custom_event.fb_mobile_initiated_checkoutYes
app_custom_event.fb_mobile_level_achievedYes
app_custom_event.fb_mobile_purchaseYes
app_custom_event.fb_mobile_rateYes
app_custom_event.fb_mobile_searchYes
app_custom_event.fb_mobile_spent_creditsYes
app_custom_event.fb_mobile_tutorial_completionYes
app_custom_event.otherYes
cost_per_mobile_achievement_unlockedYes
cost_per_mobile_activate_appYes
cost_per_mobile_add_payment_infoYes
cost_per_mobile_add_to_cartYes
cost_per_mobile_add_to_wishlistYes
cost_per_mobile_complete_registrationYes
cost_per_mobile_content_viewYes
cost_per_mobile_initiated_checkoutYes
cost_per_mobile_level_achievedYes
cost_per_mobile_purchaseYes
cost_per_mobile_rateYes
cost_per_mobile_searchYes
cost_per_mobile_spent_creditsYes
cost_per_mobile_tutorial_completionYes
offline_conversionNo
offline_conversion.add_payment_infoNo
offline_conversion.add_to_cartNo
offline_conversion.add_to_wishlistNo
offline_conversion.complete_registrationNo
offline_conversion.initiate_checkoutNo
offline_conversion.leadNo
offline_conversion.otherNo
offline_conversion.purchaseNo
offline_conversion.searchNo
offline_conversion.view_contentNo
cost_per_offline_conversionNo
cost_per_offline_otherNo
offsite_conversionYes
offsite_conversion.fb_pixel_add_payment_infoYes
offsite_conversion.fb_pixel_add_to_cartYes
offsite_conversion.fb_pixel_add_to_wishlistYes
offsite_conversion.fb_pixel_complete_registrationYes
offsite_conversion.fb_pixel_initiate_checkoutYes
offsite_conversion.fb_pixel_leadYes
offsite_conversion.fb_pixel_purchaseYes
offsite_conversion.fb_pixel_searchYes
offsite_conversion.fb_pixel_view_contentYes
offsite_conversion.fb_pixel_otherYes
cost_per_add_payment_info_fbYes
cost_per_add_to_cart_fbYes
cost_per_add_to_wishlist_fbYes
cost_per_complete_registration_fbYes
cost_per_initiate_checkout_fbYes
cost_per_lead_fbYes
cost_per_purchase_fbYes
cost_per_search_fbYes
cost_per_view_content_fbYes
link_clickYes
cost_per_link_clickYes
likeYes
offsite_engagementYes
postYes
post_commentYes
post_engagementYes
cost_per_post_engagementNo
post_likeYes
post_reactionYes
view_contentYes
video_playYes
voteYes
unique_clicksNo
reachNo
lifetime_impressionsNo
lifetime_spentNo
today_spentNo
yesterday_spentNo

Advanced Filters

You can customize and derive advanced fields based off the insights and metadata filters above. For more information, see Advanced Evaluation Spec Filters.

Advanced filters support the following operators: GREATER_THAN, LESS_THAN, EQUAL, IN_RANGE, NOT_IN_RANGE. They are only supported by Schedule Based Rules.

For some of the most commonly used advanced filters, an alias is supported as the filter:

Advanced Field AliasDerived From
daily_ratio_spenttoday_spent / adset.daily_budget
lifetime_ratio_spentlifetime_spent / adset.lifetime_budget

Unofficial mirror for reference/search purposes. All content originates from developers.facebook.com — see the source link at the top of each page. Machine-readable indexes: llms.txt · llms-full.txt · About