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:
- Name - a label for your reference (e.g. “German visitors”)
- Conditions - one or more checks that must ALL be true (AND logic)
- 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
| Field | Description | Example values |
|---|---|---|
country | Two-letter country code (ISO 3166-1) | US, DE, GB, FR, JP |
continent | Two-letter continent code | NA, EU, AS, SA, AF, OC, AN |
device | Device type | mobile, desktop, tablet |
os | Operating system | iOS, Android, Windows, macOS, Linux |
browser | Browser name | Chrome, Safari, Firefox, Edge |
Team plan and above (all Pro fields plus)
| Field | Description | Example values |
|---|---|---|
language | Browser language (from Accept-Language header) | en, de, fr, ja, zh |
referrer | Referring domain (www stripped) | google.com, twitter.com, linkedin.com |
time | Current hour in UTC (0-23) | 9, 14, 22 |
day | Day of week (lowercase, 3-letter) | mon, tue, wed, thu, fri, sat, sun |
query | URL query parameter value | utm_source=twitter |
cookie | Cookie value | variant=b |
click_count | Total clicks on this link (updated daily) | 1000, 5000 |
Operators
| Operator | Description | Works with |
|---|---|---|
eq | Equals (case-insensitive) | All string/numeric fields |
neq | Not equals | All string/numeric fields |
contains | Contains substring | browser, referrer, query, cookie |
starts_with | Starts with | browser, language, referrer, query |
in | Value is in list | country, continent, device, os, browser, language, referrer, time, day |
not_in | Value is not in list | country, continent, device, os, browser, language, referrer, time, day |
gt | Greater than | time, click_count |
lt | Less than | time, click_count |
between | In 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"} }]Cookie-based routing
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
| Plan | Max rules per link | Available fields |
|---|---|---|
| Pro | 5 | country, continent, device, os, browser |
| Team | 20 | All fields |
| Agency | 50 | All 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.