Geo and device redirect rules are easiest to learn from finished setups. Below are seven of them, each as a small table you can copy into your own link: a condition on the left, a destination on the right, and a note on what the order does. Basic ideas such as how accurate IP country detection is are covered in the geo redirects post, so this one stays on the rules themselves.
First, how the engine reads them. Once that is clear, every example below is a variation on the same four moves.
Rules are checked top to bottom and the first match wins. Conditions inside one group are joined with AND, and separate groups are joined with OR. A click that matches no rule goes to the default URL. Several URLs in one rule separated by | are picked at random with equal chance. Put the narrow rules first and the broad ones last.
How the rules are read
One link sits in your ad. Behind it is a list of rules, and each click is compared with that list from the top.
- Top to bottom, first match wins. As soon as a click satisfies a rule, it goes to that rule's destination and the rest of the list is ignored.
- AND inside a group. If a group says country is Germany and device is mobile, the click must be both.
- OR between groups. If a rule has two groups, a click that satisfies either group triggers the rule.
- Default URL. A click that matches nothing goes to the main URL. Always set it to something useful, because every unexpected visitor ends up there.
- Equal split with
|.https://a.example/offer|https://b.example/offersends each matching click to one of the two at random, with equal chance.
The conditions you can use include country, city, device type and model, OS, browser, ISP or provider, language, referrer, URL parameters, day of week and time. There are more than twenty in total. The examples use the common ones. All the domains and URLs below are made up.
Example 1. One offer, different landers per country
The classic. Your offer has local landers for three markets, and everyone else gets an English page.
| # | Condition | Destination |
|---|---|---|
| 1 | Country = DE | https://de.example.com/offer |
| 2 | Country = FR | https://fr.example.com/offer |
| 3 | Country = ES | https://es.example.com/offer |
| Default | Everything else | https://example.com/offer |
Order does not matter here because the conditions never overlap. It starts to matter in the next examples.
Example 2. Country and device in one rule
An app install offer pays only for mobile users in one country. Desktop visitors from the same country should see a web version.
| # | Condition | Destination |
|---|---|---|
| 1 | Country = BR AND device type = mobile | https://example.com/app-br |
| 2 | Country = BR | https://example.com/web-br |
| Default | Everything else | https://example.com/global |
Rule 1 is narrower, so it goes first. Swap the two and every visitor from Brazil lands on the web page, because rule 2 matches before rule 1 gets a chance. This is the most common ordering mistake, so test it with a click from each device.
Example 3. Separate offers for iOS and Android
Some offers exist only for one platform. Group conditions by OS inside a single country.
| # | Condition | Destination |
|---|---|---|
| 1 | Country = US AND OS = iOS | https://example.com/ios-offer |
| 2 | Country = US AND OS = Android | https://example.com/android-offer |
| Default | Everything else, desktops included | https://example.com/web-offer |
Desktop visitors from the US fall through to the default, which is fine here. If you want a separate page for them, add a third rule with the country and a desktop device type before the default.
Example 4. Using OR to cover a group of countries
A single offer works for several neighbouring markets. Instead of copying the rule three times, give one rule three groups.
| Group | Conditions (AND) | Destination |
|---|---|---|
| A | Country = PL | https://example.com/eu-offer |
| B | Country = CZ | |
| C | Country = SK |
A click from any of the three countries triggers the rule, because groups are joined with OR. If you accidentally put all three countries in one group, nobody matches: no click can be in Poland and the Czech Republic at once, because AND inside a group demands both.
Example 5. Splitting traffic evenly with a pipe
You want to compare two landers on the same audience without a separate tool.
| # | Condition | Destination |
|---|---|---|
| 1 | Country = IT AND device type = mobile | https://a.example.com/lander|https://b.example.com/lander |
| Default | Everything else | https://example.com/lander |
Each matching click picks one of the two URLs at random with equal chance. With, say, 1,000 hypothetical clicks you would expect roughly 500 each, with normal random drift. The pipe gives an equal split only. For uneven shares such as 50/30/20 use the link rotator, where destinations carry weights that you can change at any time while the link stays the same.
Example 6. Language as a second signal
Country says where the connection comes from. The language setting says what the person reads. For a market where both languages are common, use language to choose the page.
| # | Condition | Destination |
|---|---|---|
| 1 | Country = CH AND language = de | https://example.com/de |
| 2 | Country = CH AND language = fr | https://example.com/fr |
| 3 | Country = CH | https://example.com/en |
| Default | Everything else | https://example.com/en |
Rule 3 catches Swiss visitors whose language is neither German nor French. Without it they would reach the default anyway, but keeping the rule makes the intent visible to whoever edits the list next.
Example 7. Time of day and a source check
Say an offer has a call centre that works in the daytime, and a second offer that takes sign-ups around the clock. Time and day of week are conditions too.
| # | Condition | Destination |
|---|---|---|
| 1 | Country = AU AND day of week = Mon to Fri AND time = 09:00 to 18:00 | https://example.com/call-offer |
| 2 | Country = AU | https://example.com/form-offer |
| Default | Everything else | https://example.com/global |
In TDS.SO time and day of week conditions are checked in UTC, so convert the call centre's hours first: 09:00 to 18:00 in Sydney is 22:00 to 07:00 UTC, starting the previous evening, while Sydney is on summer time (October to April). Test with a click just inside and just outside the window. Statistics follow the time zone in your profile, so the same click can land on a different day in the report than in the rule.
Mistakes that cost clicks
- Broad rule above a narrow one. The narrow one never fires. Read the list top to bottom as if you were the click.
- Everything in one group. AND inside a group is strict. Use separate groups when you mean "this or that".
- Empty or weak default. Unmatched traffic is real traffic you paid for. Point the default at your most general offer.
- City conditions that are too tight. City detection is less reliable than country detection, so use it for a bonus rule and keep a country rule below it.
- Forgetting the filter. Rules route people. Bots in the same stream need a separate filter level, covered in traffic filtering.
How to test a rule set before the budget runs
- Write the list on paper first, narrow rules at the top.
- For every rule, name one real visitor profile that should hit it and one that should not.
- Open the link from a phone, a laptop and a VPN set to the target country, if you use one for checks.
- Look at the click log. It shows country, device and browser for each click, so you can see which profile went where.
- Change one thing at a time. The ad link does not change when you edit rules, so you can adjust while the campaign is running.
A full walkthrough, click by click
Take Example 2 and follow three hypothetical clicks through it. The list is: rule 1 is country BR AND mobile, rule 2 is country BR, and the default is the global page.
| Click | What the click looks like | Rule 1 | Rule 2 | Goes to |
|---|---|---|---|---|
| A | Brazil, phone | Matches | Not checked | app-br |
| B | Brazil, laptop | No, device differs | Matches | web-br |
| C | Portugal, phone | No, country differs | No | global (default) |
Click A never reaches rule 2, because the engine stops at the first match. Click B fails rule 1 on one condition and that is enough, since every condition in a group has to hold. Click C matches nothing and falls to the default. If you can trace your own clicks through your own list this way, you understand the rules well enough to edit them without guessing.
When a rule set grows past eight or ten lines, add a short comment in your own notes next to each one: who it is for and why it sits where it does. Six months later that note will save you an hour.
FAQ
What happens when two rules match the same click?
The higher one wins. The engine stops at the first match and never looks at the rest.
How do I send "Germany or Austria" to the same page?
Create one rule with two groups, one for each country. Groups are joined with OR. Putting both countries in one group would require the click to be in both at once.
Can I split traffic 50/50 inside a rule?
Yes. Put two URLs in the destination separated by |. Each click picks one at random with equal chance. For other shares use the link rotator.
What does the default URL do?
It receives every click that matches no rule. It is the safety net, so make it a page that makes sense for any visitor.
Do I need to change the ad when I edit rules?
No. The ad keeps one link. You change rules and URLs in the dashboard.
To build these setups, see redirect rules in TDS.SO, and pair them with a filter level so the clicks you route are mostly human.
Guides and write-ups on routing, bot filtering and tracking from the TDS.SO team.
All articles by the author