A geo redirect sends a visitor to different pages depending on where they come from: the country is determined by IP address, the language by browser settings and the device by the user agent string. One link in the ad, and behind it a German visitor lands on a German offer, a Brazilian on a Portuguese one and an iPhone owner on an iOS page.
It sounds like a single line of code, but that line hides plenty of pitfalls: inaccurate geolocation, VPNs, caching, search crawlers that only see one version of the site. Below: why you need a redirect by country and device, how it works inside and how to build one for paid traffic without losing visitors.
Why you need a geo redirect
The reasons people set one up come down to a single idea: different people need different things.
- Different offers by country. An affiliate network pays differently for the same product in different geos, and sometimes each country has a separate offer with its own landing page. Without a redirect by country, a multi-country campaign needs a separate link, and often a separate campaign, for every geo. On grouping countries by revenue, see the article on Tier 1, Tier 2 and Tier 3 countries.
- Language versions. A visitor from Switzerland may speak German, French or Italian. IP country helps little here, while browser language helps a lot.
- Mobile and desktop versions. A mobile subscription, an app store listing, a form with a phone field or a long review for desktop: a page built for the device converts better than a one-size-fits-all page.
- Operating system. An Android app leads to Google Play, an iOS app to the App Store, desktop to a page with a QR code.
- Legal restrictions. If a product cannot be sold in a certain country, it is more honest to send its visitors to an information page than to an order form.
How a redirect by country works
The mechanics are the same in every system and consist of three steps.
1. IP to country lookup
The server takes the visitor's IP address and looks it up in a geolocation database, a table that maps address ranges to country, region, city, provider and network (ASN). These databases are built from address registry data, provider data and measurements, so accuracy varies: high at country level for residential and mobile networks, noticeably lower at city level.
If the site sits behind a CDN or a hosting proxy, it is important to take the visitor's real address from a trusted header rather than the address of the intermediate server. Otherwise every visitor will appear to be "from the data center's country".
2. Matching against rules
Next, the detected attributes are checked against rules: "country is DE or AT", "device is smartphone", "language is pt". Rules are checked in a set order and the first match wins. You always need a default route for everyone who matches no rule, otherwise some of the traffic you paid for is lost.
3. The redirect itself
There are three ways to send a visitor to a URL:
| Method | How it works | Pros and cons |
|---|---|---|
| Server redirect 302/307 | The server responds with a status code and a new URL | Fast, works without JavaScript; the address bar changes |
| JavaScript redirect | The page loads, then a script changes the URL | A visible flash, lost time, does not work without JS |
| In-place loading | The server returns the right page under the same URL | The URL stays the same, no extra hop; needs support on the service side |
A geo redirect uses temporary status codes, 302 or 307. Browsers and intermediate caches remember a permanent 301, and someone who once got the "German" version will keep getting it after turning off their VPN.
Device targeting redirect: mobile and desktop versions
Device type is determined from the user agent string and, in Chromium-based browsers, from Client Hints headers. That is enough for routing: ordinary people do not fake the string, and a detection mistake is cheap. What the string contains and why it is not enough for bot protection is covered in the article on user agent filtering.
A few practical points:
- Tablets. Decide in advance whether they go to the mobile or the desktop version. Different systems classify them differently by default.
- In-app browsers. A visitor from a social network opens the link in the app's built-in browser. It is a smartphone and should go to the mobile page, even if the UA string looks unusual.
- Combining with OS. "Smartphone + iOS" and "Smartphone + Android" are two separate branches if the offer leads to an app store.
Geo redirect pitfalls
VPN and proxy
A person on a VPN gets the country of the exit server. If they are in Poland and the VPN exits in the Netherlands, a redirect by country sends them to a Dutch offer that does not fit them and that the affiliate network may not pay for. For ad campaigns this kind of traffic is usually unwanted anyway; how VPNs, proxies and hosting addresses are detected is covered in the article on VPN, proxy and data center IP detection.
Geolocation accuracy
Mobile carriers sometimes route traffic through a neighboring country, corporate networks through head office, satellite internet through the operator's country. City by IP is wrong even more often, so build a city-level redirect only where an error is not critical.
Tip. For language versions, rely on the browser language and use IP country as a hint. The language is something the person chose; the IP depends on which network they happen to be on today.
Caching
If a page with a geo redirect is cached on a CDN without taking the country into account, the first visitor determines the response for everyone else. A response that depends on the visitor is either not cached at all or cached with a key that includes country and device.
SEO and hreflang for regular websites
This is the main trap for sites that rely on search. Search crawlers come from a limited set of addresses, most often from one country. With a hard IP based redirect the crawler sees only one version of the site, and the others simply never get indexed.
Search engines recommend a different approach:
- Each language or regional version lives at its own URL and opens directly, without a forced redirect.
- Versions are linked with hreflang attributes so the search engine shows the right one in results.
- A visitor from "another" country sees an unobtrusive banner, such as "Looks like you are in Germany, switch to the German version?", and the choice is remembered.
For a paid landing page that is not promoted in search this usually does not matter: people arrive via the ad link. But if the same site serves both ads and organic traffic, keep the forced redirect by country for the ad link only.
Matching the ad
Ad platforms require the page to match the ad for users in the region the ad targets. A geo redirect to different offers by country is normal practice as long as each version honestly matches what the ad promises in that country. We collected the relevant platform rules in the article on Meta advertising policies.
Geo redirect vs country filter vs TDS
These three concepts often get mixed up.
- A country filter decides whether to let a visitor in at all. The wrong geo gets a stub page. More in the article on geo and device filtering.
- A geo redirect lets in everyone who passed the filter but shows different people different pages.
- A TDS is a complete traffic distribution system: geo and device are only two of many conditions, alongside weights, priorities, tags and link parameters. The overall logic is described in the article on the TDS traffic distribution system.
In a working setup they go one after another: the filter cuts bots and unwanted countries, and the remaining traffic is split between offers.
How to set up a redirect by country and device in ArtisanClo
In ArtisanClo a geo redirect is built with flow branches. Branches are available from the Professional plan in tracker modes, when a flow has two or more offers.
How a branch works. The Add a branch button creates a branch with a "Country is one of" condition. A condition reads as "If [field] [operator] [values]", and a branch can hold several conditions, in which case all of them must be met at once.
Condition fields: country, device, OS, browser, provider, ASN, city, region, language, referrer, link parameter and tag (sub). Operators are is one of, is none of, contains, is set and is not set. Values are listed separated by commas.
Order. Branches are checked from top to bottom and the first match decides; the order is changed with the Up and Down arrows. Visitors who match no branch go to the offers without a branch, and that is your default route. If a branch has no offers, its visitors also go to the default offers.
Attaching offers. The offer card has a Branch field. Inside a branch, offers share traffic by weights, and the Auto weights button splits it evenly within each set, separately for offers without a branch and for the offers of each branch.
Display method. An offer has three modes: Loading, where the offer page opens under your ad URL; Redirect, a temporary 302 redirect to the offer URL; and Frame, where the page is embedded in yours. The temporary code is chosen deliberately, for the reasons described above.
Visitor pinning. If a person comes back, the Visitor pinning, h field sends them to the same pre-lander and the same offer instead of a random one within the branch.
Example: a campaign for Germany, Austria and Brazil.
- Branch "DACH": "Country is one of DE, AT" → German offer.
- Branch "BR mobile": "Country is one of BR" and "Device is one of Mobile" → mobile offer in Portuguese.
- No branch: everything else → main offer.
Importantly, branches work after filtering: a visit first goes through checks for bots, VPN and audience rules, and only a visitor who has been let through picks an offer by branches and weights. If you do not need a geo at all, close it in Audience rather than sending it to a fallback offer.
Reports by branch. Statistics have a "branch" breakdown showing how many clicks, conversions and how much money each branch brought. That turns a geo redirect from a by-eye setting into an experiment you can check with numbers; the approach to such checks is described in the article on split testing. All routing features are on the features page, and plan terms are on the pricing page.
Common mistakes
- No default route. Visitors from countries you did not account for get lost or see an error.
- A permanent 301 redirect. Browsers remember it, and the visitor gets stuck in one version for good.
- Language by IP. Country is not language: think Belgium, Switzerland, Canada.
- An IP based redirect on a site with organic traffic. The search engine sees one version, the rest drop out of the index.
- Too many branches on little traffic. Each branch splits the statistics, and you cannot draw conclusions about any of them.
Summary
A geo redirect is a simple tool with tricky edges. Determine country by IP, language by browser and device by user agent; use temporary status codes; always keep a default route; for regular sites with search traffic, replace the forced redirect with hreflang markup and a banner. In advertising, a redirect by country and device works best together with a filter: first cut bots and unwanted geos, then send real visitors to the right offers and watch each branch's results in the reports.



