logo
Links

Send each visitor to the right destination with Smart Rules

Smart Rules route one short link or QR code to different destinations by device, country, language, campaign, referrer — or split traffic for an A/B test.

Avatar for undefined
CodeQR Team
Content Team

One short link or one printed QR code, many destinations: with Smart Rules you decide where each visitor lands based on their device, location, browser language, the campaign that brought them, or the site they came from — and you can split traffic between destinations to run an A/B test. Read this page to understand what a rule is and pick the guide for your job.

Availability

  • Plan: Business and above (pricing). On lower plans the toggle shows a Business badge and the API rejects the request.
  • Where: in the link builder (LinksAdd Link, or open a link and choose Edit), turn on Smart Rules in the optional features list. Dynamic QR codes of type URL have the same section in the QR code editor. Static QR codes cannot use Smart Rules.

The Smart Rules toggle switched on in the link builder, showing one empty rule with Device, is, Select value, a Split traffic (A/B test) switch, a Destination URL field and an Add rule button

What a rule is

A rule reads as a sentence: if attribute is / is not value, then send the visitor to destination.

  • Attribute — what CodeQR checks on the incoming request:
  • Device: the operating system (iOS, Android, Windows, macOS, Linux)
  • Location: Country, Region (state), City, Continent — from the visitor's IP address
  • Campaign: UTM Source, UTM Medium, UTM Campaign, UTM Term, UTM Content — read from the query string on your short link
  • Referrer — the site the visitor came from
  • Language — the browser's preferred language
  • Operatoris or is not. The value must match completely (case does not matter); there is no "contains".
  • Destination URL — where matching visitors go. Instead of one URL, turn on Split traffic (A/B test) to send matching visitors to 2–4 variant URLs by percentage.

A rule with no condition is called All traffic. It always splits traffic, and it must be the last rule.

Two rules in the link builder: Device is iOS with an App Store URL, and Device is Android with a Google Play URL

How CodeQR decides

Rules run top to bottom. The first rule that matches wins. If no rule matches, the visitor goes to the link's Destination URL. Each rule has exactly one condition; to combine conditions, order the rules so the most specific comes first. The full decision path, including how Smart Rules interact with Link Cloaking, iOS Targeting, Android Targeting and Geographic Targeting, is in How Smart Rules choose a destination.

Pick your guide

Limits at a glance

  • Up to 20 rules per link or QR code
  • 2 to 4 variants per split; whole-number weights that add up to 100
  • Rules are evaluated on links and on dynamic URL QR codes; not on static QR codes, and not on QR codes of other types (Wi-Fi, vCard, WhatsApp, text)
  • Available in the web app, the REST API (rules field on links and QR codes), the MCP server (create_link and update_link), and — through the API — automation platforms

Smart Rules and the older targeting toggles

The link builder still has iOS Targeting, Android Targeting and Geographic Targeting. Smart Rules cover the same cases and more, and a matching Smart Rule takes precedence over those toggles. Use Smart Rules for new links; you do not need to turn the older toggles on.

The optional features list in the link builder showing iOS Targeting, Android Targeting, Geographic Targeting and Smart Rules toggles

Related articles