background map

Redirect Visitors By Country:
A Step-By-Step Guide



So you’re thinking of setting up your website to redirect visitors by country, but you’re not sure how to go about doing so. In this article, we explain to you the importance of serving your visitors relevant content using URL redirection, and teach you how to automatically redirect visitors by country. Let’s jump right in!

Why Should I Redirect Visitors By Country?

In a nutshell, companies and brands redirect visitors by country so that they can serve them content that’s tailored to their needs.

Let’s take the world of eCommerce, for example. If you’re selling products to consumers from around the world and having all these consumers access a single, standard website, this provides them with a less-than-ideal experience.

determine geolocation using IP address for redirecting

For example, when consumers from UK are browsing your site, they’ll have to go through the hassle of converting the price of your products to their own currency. When consumers from France or Germany visit your website, they’ll have to deal with a language barrier, because English isn’t their first language. Of course, they can simply use Google Translate to translate the page, but these translations are often inaccurate. (That’s not to mention: consumers have limited attention spans, and they probably won’t bother).

At the end of the day, you want to reduce as much friction as possible and make purchasing items on your website a pleasant, fuss-free experience. And if you direct all your consumers to a single page that doesn’t account for their different needs, that’s not going to happen.

Minimizing friction aside, redirecting visitors by country also helps you target them and serve them better offers. Most eCommerce stores run promotions in conjunction with public holidays and festivals, for example. The promotions you’ll want to offer to your visitor are highly dependent on where your visitor is based - if they’re from Australia, it makes more sense to run an Anzac Day 20% Off special rather than a Fourth Of July promotion.

What if my products and services aren’t available internationally?

Even if you’ve not taken your company international yet, there’s a high chance that you’ll do so in the near future.

Say you own a fashion business based in the US, for example. With local eCommerce growth being sluggish (in comparison to growth in Asian markets, especially China), you’ll probably have to start serving overseas customers assuming that you do want to increase your revenue and profits.

geo redirecting to china

Image source - https://sampi.co/wp-content/uploads/2013/05/ecommerce_China.png

Redirecting visitors by country aside, plenty of smaller-sized, local businesses also make it a key part of their strategy to redirect visitors by state or redirect visitors by city.

For example, say you own a VoIP company and you’re serving clients throughout the US. You might only be able to offer 24/7 support to a select group of customers (say, the ones in Michigan, where you’re headquartered). Of course, you can simply state these limitations on your Support page or FAQ page, but you’re worried that this will affect your business, and make clients outside of Michigan less likely to work with you.

What do you do? Simple - go ahead and set up rules to redirect visitors by state.

How To Redirect Visitors By Country

How does URL redirection by visitor country work? Well, you’ll have to configure your website to determine the IP address of your visitors, and match these addresses with a database that tells you where your visitors are currently located. Once your website is able to determine a visitor’s location, the next step is to implement redirect code so that each visitor gets redirected to a different domain or subdomain.

We’re not going to lie… if you don’t have any technical background or expertise, it’ll be difficult for you to develop code that can help you locate a visitor’s whereabouts using their IP address and carry out redirects. That said, there are some simple plug-and-play solutions that you can use to achieve the same effect.

Geo Targetly’s Geo Redirect tool, for example, is designed for marketers and business owners who want to redirect visitors by country without getting into all the technical nitty-gritty. You can easily set up your redirection criteria using our visual dashboard, and zero coding experience is required.

Three-Step Guide To Redirect Visitors By Country

First, type in the landing URL, the redirect URL and the location of the visitor.

Adding country rules to geo redirect

Next, retrieve a small snippet of Javascript code that Geo Targetly generates.

Last but not least, copy and paste the code just after the opening head tag in your website’s HTML.

That’s all there is to it!

Advanced redirecting with Geo Targetly

With Geo Targetly, there is no limit on the number of urls you can create and the number of location segments you can build. The best part? Geo Targetly’s tool enables you to get highly specific with your location segments; you can even use the negative location segments to redirect everyone outside a set of locations.

Here are a few examples:

  • - IF the visitor is from California, THEN redirect to www.example.com/california
  • - IF the visitor is from Texas, THEN redirect to www.example.com/texas
  • - IF the visitor is from Florida or Utah, THEN redirect to www.example.com/forida-utah
  • - IF the visitor is outside the US, THEN redirect to www.example.com/other-locations
  • - IF the visitor is inside the US, but outside Texas, THEN redirect to www.example.com/other-locations
    • With Geo Targetly’s custom URL mapping feature, you can also redirect visitors from particular pages of your website to specific pages of another website. Say you’re updating the URL of your membership site’s login page, but you know that plenty of members have bookmarked the existing URL. Simply set up a rule that redirects them to the new login page whenever they try to access the old page!

      Geo Targetly is a simple, plug-and-play tool that lets you redirect visitors by IP addresses, countries, states, cities, and more. To start redirecting your visitors, and have your conversion rates and revenue shoot through the roof, claim your free trial now!

Geo target your audience & boost conversion rate