Skip to content
noBSredir

Rules engine

The rules engine lets you set up conditional redirects on any link. Instead of creating separate links for each audience, use one link with rules that route visitors to different destinations based on who they are, where they’re from, and when they click.

Rules are evaluated top-to-bottom. First match wins. If no rule matches, the link’s default target is used.

Requires a Pro plan or higher.

How it works

Each rule has three parts:

  1. Name - a label for your reference (e.g. “German visitors”)
  2. Conditions - one or more checks that must ALL be true (AND logic)
  3. Action - where to redirect when all conditions match

Rules are evaluated in order. The first rule whose conditions all pass wins. If no rule matches, the visitor goes to the link’s default target URL.

Available fields

Pro plan

FieldDescriptionExample values
countryTwo-letter country code (ISO 3166-1)US, DE, GB, FR, JP
continentTwo-letter continent codeNA, EU, AS, SA, AF, OC, AN
deviceDevice typemobile, desktop, tablet
osOperating systemiOS, Android, Windows, macOS, Linux
browserBrowser nameChrome, Safari, Firefox, Edge

Team plan and above (all Pro fields plus)

FieldDescriptionExample values
languageBrowser language (from Accept-Language header)en, de, fr, ja, zh
referrerReferring domain (www stripped)google.com, twitter.com, linkedin.com
timeCurrent hour in UTC (0-23)9, 14, 22
dayDay of week (lowercase, 3-letter)mon, tue, wed, thu, fri, sat, sun
queryURL query parameter valueutm_source=twitter
cookieCookie valuevariant=b
click_countTotal clicks on this link (updated daily)1000, 5000

Operators

OperatorDescriptionWorks with
eqEquals (case-insensitive)All string/numeric fields
neqNot equalsAll string/numeric fields
containsContains substringbrowser, referrer, query, cookie
starts_withStarts withbrowser, language, referrer, query
inValue is in listcountry, continent, device, os, browser, language, referrer, time, day
not_inValue is not in listcountry, continent, device, os, browser, language, referrer, time, day
gtGreater thantime, click_count
ltLess thantime, click_count
betweenIn range (inclusive)time, click_count

Examples

Route by country

Send German visitors to your German landing page, everyone else to the English version.

[
{
"name": "Germany",
"conditions": [{"field": "country", "operator": "eq", "value": "DE"}],
"action": {"type": "redirect", "url": "https://example.de/seite"}
}
]

Route by continent

Send all European visitors to your EU page.

[
{
"name": "Europe",
"conditions": [{"field": "continent", "operator": "in", "value": ["EU"]}],
"action": {"type": "redirect", "url": "https://example.com/eu"}
}
]

Mobile vs desktop

[
{
"name": "Mobile users",
"conditions": [{"field": "device", "operator": "eq", "value": "mobile"}],
"action": {"type": "redirect", "url": "https://m.example.com"}
},
{
"name": "Tablet users",
"conditions": [{"field": "device", "operator": "eq", "value": "tablet"}],
"action": {"type": "redirect", "url": "https://m.example.com"}
}
]

Multi-condition: country + device + time

Send US mobile visitors during business hours to a specific page.

[
{
"name": "US mobile daytime",
"conditions": [
{"field": "country", "operator": "eq", "value": "US"},
{"field": "device", "operator": "eq", "value": "mobile"},
{"field": "time", "operator": "between", "value": ["14", "22"]}
],
"action": {"type": "redirect", "url": "https://example.com/us-mobile-promo"}
}
]

Note: time is in UTC. US business hours (9am-5pm ET) = 14-22 UTC.

Referrer-based routing

Send visitors from LinkedIn to your professional page.

[
{
"name": "LinkedIn traffic",
"conditions": [{"field": "referrer", "operator": "contains", "value": "linkedin"}],
"action": {"type": "redirect", "url": "https://example.com/professional"}
}
]

Language-based routing

Route French-speaking visitors to the French version.

[
{
"name": "French speakers",
"conditions": [{"field": "language", "operator": "eq", "value": "fr"}],
"action": {"type": "redirect", "url": "https://example.fr/page"}
}
]

Click count threshold

After 1000 clicks, redirect to a “sold out” page.

[
{
"name": "Sold out",
"conditions": [{"field": "click_count", "operator": "gt", "value": "1000"}],
"action": {"type": "redirect", "url": "https://example.com/sold-out"}
}
]

Note: click_count is updated by a daily rollup, not in real-time. There may be up to a 24-hour delay.

Fallback chain with catch-all

Route specific countries, then everyone else.

[
{
"name": "Germany",
"conditions": [{"field": "country", "operator": "eq", "value": "DE"}],
"action": {"type": "redirect", "url": "https://example.de"}
},
{
"name": "France",
"conditions": [{"field": "country", "operator": "eq", "value": "FR"}],
"action": {"type": "redirect", "url": "https://example.fr"}
},
{
"name": "Rest of Europe",
"conditions": [{"field": "continent", "operator": "eq", "value": "EU"}],
"action": {"type": "redirect", "url": "https://example.com/eu"}
},
{
"name": "Everyone else",
"conditions": [],
"action": {"type": "redirect", "url": "https://example.com/global"}
}
]

A rule with empty conditions always matches - use it as a catch-all at the bottom.

Weekend vs weekday

[
{
"name": "Weekend",
"conditions": [{"field": "day", "operator": "in", "value": ["sat", "sun"]}],
"action": {"type": "redirect", "url": "https://example.com/weekend-deal"}
}
]

Query parameter routing

Route based on a URL parameter. Format: key=value.

[
{
"name": "Twitter traffic",
"conditions": [{"field": "query", "operator": "eq", "value": "utm_source=twitter"}],
"action": {"type": "redirect", "url": "https://example.com/from-twitter"}
}
]

Route returning visitors who have a specific cookie.

[
{
"name": "Returning customer",
"conditions": [{"field": "cookie", "operator": "eq", "value": "customer=true"}],
"action": {"type": "redirect", "url": "https://example.com/welcome-back"}
}
]

Plan limits

PlanMax rules per linkAvailable fields
Pro5country, continent, device, os, browser
Team20All fields
Agency50All fields

Interaction with other features

Legacy routing rules: If a link has both rules engine rules and legacy geo/device/OS routing rules, the rules engine takes priority. Legacy routing rules only apply if no rules engine rule matches.

A/B testing: If a rule matches, A/B testing is skipped entirely. A/B variants only apply when no rule (and no legacy routing rule) matches. This lets you use rules for specific audiences and A/B test the rest.

UTM parameters: UTM params are appended to the final redirect URL, including rule-matched URLs.

Deep links: Deep link handling runs after rules resolve the target. The resolved URL becomes the web fallback for the deep link.

Expiration: Expiration is checked before rules. An expired link never evaluates rules.

Password protection: Password is checked before rules. Visitors must enter the password first.

Performance

Rules add zero latency to redirects. All condition data (country, device, browser, language, etc.) comes from request headers and connection metadata that’s already available - no additional database queries or API calls.