Optimize
Routing rules and A/B tests
Send scanners to different destinations by country, device, language, or time of day, or split traffic between variants.
One dynamic QR code can send different people to different places. Choose a routing mode on the code: a single destination, targeting rules, or an A/B split. Rules and A/B tests are available on paid plans, see plans and billing.
What routing modes are there?
- Single: every scan goes to the one destination. This is the default.
- Rules: targeting rules decide the destination. If no rule matches, the scan goes to the code's default destination.
- A/B: traffic is split across weighted variants.
You manage rules on the Targeting tab and variants on the A/B Variants tab of the code.
How do targeting rules work?
Rules are checked in order from top to bottom, and the first enabled rule that matches wins. Move rules up or down to change priority. You can switch any rule off without deleting it. A code can have up to 25 rules. Each rule has a label and a "Redirect to URL".
A rule can match on one of these conditions:
| Condition | What you enter |
| --- | --- |
| Country or region | Countries as two-letter ISO codes, comma separated, for example US, CA. Regions can be added too |
| Device type | Mobile, tablet, desktop, bot, or unknown |
| Operating system | One or more OS names, not case sensitive |
| Language | Language codes such as en or es, matched on the prefix |
| Time | Days of the week, a start hour (0 to 23), an end hour (0 to 24), and a timezone |
Time windows can wrap past midnight, for example 22 to 6. If you do not set a timezone, UTC is used, so set one when you are scheduling by local time.
When should I use rules?
- Send mobile scanners straight to an app store page and desktop scanners to a web page.
- Show a Spanish page to browsers set to Spanish.
- Send visitors from one country to a local store.
- Point a menu code at the lunch menu during lunch hours and the dinner menu later.
How do A/B tests work?
Add up to 10 variants, each with a label, a destination URL, and a weight from 0 to 1000 (default 1). Traffic is split in proportion to the weights, so weights of 3 and 1 send about 75% and 25%. A variant with weight 0 is skipped while other variants have weight. Mark one variant as the control to keep a clear baseline. If you turn on rotation, scans take turns across the variants in sequence instead of being random.
The Analytics tab shows a "Variant performance" table with scans per variant, see scan analytics. qraffic shows you the numbers; you decide which variant to keep.
What if I change the mode later?
Changing the routing mode does not change the printed code. Existing prints keep working and follow the new mode on the next scan.