Rules

Conditions and operators

How a condition is built from a metric, a reporting period, one of six operators and a value — plus metric-to-metric comparison and time windows. This page of the AdOps documentation sits in the Rules section, last updated 20 August 2026. AdOps runs rules — conditions plus actions — against your Meta Ads campaigns on the schedule you set.

Updated

Key facts

Comparison operators
6 GREATER_THAN, LESS_THAN, GREATER_THAN_EQUAL, LESS_THAN_EQUAL, EQUAL, NOT_EQUAL
Reporting periods in the picker
11 Today through Lifetime
Metrics that accept a period
39 of 45 the other 6 are point-in-time values
Group operators per task
AND or OR one operator joins every condition in a task
Insights requests per campaign per run
1 batched request conditions are grouped by period and their fields de-duplicated first

A condition in AdOps is four choices: a metric, the reporting period to read it over, a comparison operator, and a value. Every condition in a task is joined by that task’s single AND or OR pill, and the task’s action runs only when the joined result is true.

What does one condition look like?

{
  "metric_key": "purchase_roas.omni_purchase",
  "period": "last_7d",
  "operator": "LESS_THAN",
  "value": "1.2",
  "compare": "value"
}

Read aloud: when Purchase ROAS over the last 7 days is below 1.2, this condition passes.

Which operators are available?

OperatorSymbolMenu label
GREATER_THAN>greater than
LESS_THAN<less than
GREATER_THAN_EQUALgreater than equal
LESS_THAN_EQUALless than equal
EQUAL=equal
NOT_EQUALnot equal

Forty-three of the 45 metrics expose all six. The two time-of-day metrics are the exception: Time greater than offers only GREATER_THAN, and Time less than only LESS_THAN.

Which reporting periods can I choose?

ValueLabel
todayToday
yesterdayYesterday
custom_last_3_daysLast 3 days (incl. today)
last_3dLast 3 days
custom_last_7_daysLast 7 days (incl. today)
last_7dLast 7 days
last_14dLast 14 days
last_30dLast 30 days
this_monthThis month
last_monthLast month
maximumLifetime

The plain presets are passed straight to Meta as a date_preset. The two custom_ forms are rewritten locally into an explicit time_range whose window ends today, which is why they are labelled “incl. today”.

Six of the 45 metrics have no period at all — Daily Budget, Lifetime budget, Remaining budget, Hours since creation, Time greater than and Time less than are point-in-time readings.

Comparing a metric against another metric

Every condition row carries a Compare With cog. Switching it from Value to Metric replaces the number on the right-hand side with a second metric that has its own metric key and its own reporting period. The engine resolves that second metric and multiplies your entered value by it, writing the resulting threshold back onto the condition record as custom_value.

That turns fixed thresholds into relative ones: “spend more than 2× last-7-day revenue” instead of a currency amount that goes stale.

Note the cost. The compared metric is fetched with its own separate Graph call, so each metric-to-metric condition adds one API round trip per campaign.

Time and age conditions

Time greater than and Time less than compare the current hour against a value chosen from a 24-hour list running 12:00 AM to 11:00 PM. The comparison is inclusive at the boundary, so the named hour itself always passes. Each of these conditions also accepts a day-of-week multi-select, listed Sunday first; when today is not in that list the condition fails.

Hours since creation converts a campaign’s creation timestamp into whole elapsed hours, rounded up. Pair it with any action to keep automation off campaigns that are still too young to judge.

How conditions shape the API call

Before evaluating a campaign, AdOps groups every condition by its period, takes the part of each metric key before the first dot as the Insights field, de-duplicates that list, and issues one batched Graph request covering every period the rule needs. Metrics that are not Insights fields — the time metrics, custom metrics, Daily Budget, Hours since creation and the two custom budget metrics — are excluded from that fetch and resolved separately.

A rule comparing today against the last 7 days and the last 30 days therefore costs one request, not three. Adding conditions is cheap; adding metric-to-metric comparisons is not.

Practical limits

Keep the condition set small enough to read in one breath. Every condition is stored with the actual value the engine saw and a Pass or Fail badge in the execution log, so a five-condition task is five lines to check when something surprises you.

The AdOps condition builder showing a task with time-of-day conditions across seven day tags, a nested AND group holding a lifetime spend condition under 400,000, and a second task with four stacked metric conditions. Sample data
Metric, period, operator, value — joined with AND or OR, and nestable, so a rule can say something a dropdown cannot.
The AdOps metric picker open over a condition row: a panel with Meta Ads and Custom metrics tabs, a search box, and a scrolling list of metrics with Spend selected. Sample data
Forty-five Meta metrics and your own sheet columns in the same list, each carrying a reporting period and any of six operators. Read the details

Questions about this page

What is the difference between "Last 3 days" and "Last 3 days (incl. today)"?

"Last 3 days" maps to Meta's own last_3d preset, which excludes today. "Last 3 days (incl. today)" is rewritten by AdOps into an explicit time range that ends today, so a rule reacting to a same-day change should use the incl. today form.

Can I compare one metric against another instead of a number?

Yes. The Compare With cog on a condition switches the right-hand side from Value to Metric, and the compared metric carries its own metric key and its own reporting period, so a condition can test today's figure against a different metric over a different window.

How do I restrict a rule to certain hours or weekdays?

Add a Time greater than or Time less than condition. Each has a 24-hour picker from 12:00 AM to 11:00 PM and a Sunday-first day-of-week multi-select. The named hour itself passes, because the comparison is inclusive on the boundary hour.

Which operators do the time metrics accept?

Time greater than accepts only GREATER_THAN and Time less than accepts only LESS_THAN. The other 43 metrics accept all six operators.

Read it once, then write the rule.

Everything in this manual describes a screen you can open today. Start a trial and follow along in the product rather than on the page.

Start free trial Documentation

14 days free · no card required

Inside the product

What the screens actually look like

Nine screens from the working dashboard — the rule builder, the metric picker, the dayparting grid and the log that records what happened. Scroll the strip.

  • The AdOps Performance Dashboard showing a Purchase ROAS card at 2.380x and an Aggregated ROAS card at 2.088x, both badged Profitable, a Monthly Budget card at Rp 155jt, and a Spend Breakdown ranking the top five ad accounts against a budget utilisation bar at 45.5 per cent.
    Performance Dashboard. Two ROAS figures to three decimals, a budget meter, and spend ranked by ad account — over Today, Last 7 days, Last 30 days or This month.
  • The AdOps rule list showing twelve automation rules, each with an on/off toggle, the ad accounts it manages, and when it last triggered — some minutes ago, others on a dated timestamp.
    Rule List. Every rule, what it manages and when it last fired. The toggle is the only thing between draft and live.
  • The AdOps condition builder showing a task with time-of-day conditions across seven day tags, a nested AND group holding a lifetime spend condition under 400,000, and a second task with four stacked metric conditions.
    Conditions. Metric, period, operator, value — joined with AND or OR, and nestable, so a rule can say something a dropdown cannot.
  • The AdOps metric picker open over a condition row: a panel with Meta Ads and Custom metrics tabs, a search box, and a scrolling list of metrics with Spend selected.
    Metric picker. Forty-five Meta metrics and your own sheet columns in the same list, each carrying a reporting period and any of six operators.
  • The AdOps dayparting timetable: a grid of hours against the seven days of the week, with the daytime hours filled navy for every day and the night hours and weekend evenings left empty.
    Dayparting grid. Or draw the hours instead. Anything outside the shape you fill in simply does not run.
  • An AdOps execution log detail: one campaign, two action panels badged Not Executed, each listing the action parameters and every condition evaluated with its actual value, its expected value and a Pass or Fail badge.
    Rule Log detail. Why a rule did nothing is recorded as carefully as why it did something — actual against expected, condition by condition.
  • The AdOps activity log listing budget increases and campaign renames, each row naming the affected campaign by id, the rule that caused it and how long ago it happened.
    Activity Log. One row per change AdOps made in your account, naming the campaign and the rule responsible.
  • The AdOps ad account list: eighteen Meta ad accounts with on/off toggles, account ids, Active or Inactive badges and this month’s spend in rupiah.
    Ad Accounts. Accounts discovered from Meta arrive switched off. Nothing is read, and nothing is changed, until you turn one on.
  • The AdOps custom metric editor mapping a Google Spreadsheet: a spreadsheet id, a sheet name, a column to match campaigns on and a column holding the values.
    Custom metric. Point AdOps at a sheet, name the matching column and the value column, and your own number joins the metric list.

Every figure is rebuilt from the product’s own interface and filled with invented data — no customer name, ad account or spend figure appears anywhere on this site. See how a run works