Skip to main content

How automated rules work

Britva is an autopilot for your ads. You describe a rule once, and the system itself regularly checks every live ad and, when a condition is met, performs an action — most often it pauses the ad and later returns it to work. Rules are written in JavaScript: this gives full freedom in conditions (any metric comparisons, references to neighbouring ads of the adset or campaign).

This article explains how the mechanism works as a whole. How to create a specific rule — in the Creating a rule section.

The check cycle

Every few minutes Britva runs a single pass over all active ads:

  1. It takes the fresh metrics of all live ads (spend, deposits, ROAS, etc. across different time windows).
  2. It runs all active rules over them one by one — in ascending order of priority (the Priority field: the lower the number, the earlier the rule runs).
  3. If a rule decides to pause an ad, Britva sends the command to Facebook and records a hold — who is holding the ad and until when.
  4. On each pass it also checks previously set pauses: if the term has expired or the condition is no longer met, the ad is automatically returned to work.

Every action (both pause and return) is recorded in the log — see the Logs tab.

What "active" means

Britva works only with active rules and active ads. A disabled rule is kept but does not take part in the check — this is convenient while you are still refining it.

What the section consists of

The Britva section is split into four tabs:

  • Rules — the list of all rules with their Priority, action and the Held column (how many ads the rule is currently holding on pause). Rules are created and edited from here. Read more — Creating a rule.
  • Paused — all ads that the rules are currently holding on pause. You can see which rule is holding it, until when, and you can lift the pause manually. Read more — Paused.
  • Ignore — exceptions: entities (ad, adset, campaign, account, user or team) that Britva does not touch. Read more — Ignore list.
  • Logs — the log of all triggers: time, rule, ad, action and result. Read more — Trigger logs.

Pause types

When a rule pauses an ad, it sets the duration of the pause. It determines when the ad will return to work:

  • 6h / 12h / 24h — a pause for a fixed term, after which the ad is enabled again.
  • Until midnight in the geo (next_day_target_geo) — a pause until the start of the next day in the time zone of the ad's country.
  • Until midnight in the account (next_day_ad_account) — a pause until the start of the next day in the time zone of the ad account.
  • While the condition matches (while_matches) — without a fixed term: the ad is held on pause exactly as long as the rule keeps triggering. As soon as the condition stops being met, the ad returns on its own.
  • Permanent (permanent) — a pause with no return term; it can only be lifted manually.

Read more about each type and how to set it in a rule — in the Scheduling and pauses section.

Self-protection

Britva is designed so that a rule does not reach beyond its zone:

  • Scope. A personal rule (user) checks only your ads, a team rule (team) — only the ads of its team, and only a global rule (global) applies to everyone. Other people's ads will not be affected by your rule.
  • Ignore list. Any entity can be added to the exceptions — Britva will skip it entirely during the check. Six levels: from a single ad to a whole team. Read more — Ignore list.
  • Blocked accounts are skipped. If an ad account is disabled or restricted by Facebook, Britva does not try to manage it.
Tip

It is safer to break in a new rule first: save it disabled, open the rule and use the Test panel on the right side of the editor to run it on live data, and only enable it after checking the result. Read more — Testing a rule.

What's next