How to split traffic across multiple landing pages based on visitor IP address

Giorgi Mez @

You will sometimes need to serve different content to people coming from different locations. And one way to do this is to forward the visitors to different URLs based on the IP addresses.

There are myriad tools and services that offer this feature. Yet, most of them are based on an approach that I personally do not like at all: embedding a 3rd party script on your site. And there are two main reasons for my discontent:

  1. A script needs to be embedded, meaning someone (likely a developer) needs to be involved. This makes things inconvenient for a marketer who is running an ad and needs the ad traffic to be split.
  2. It's just slow: a page needs to be loaded, then the IP needs to be checked, then a redirect needs to happen and then a new page needs to be loaded.

On platforms like WordPress or Shopify the 1st issue is solvable: you can install a plugin or an app without a developer. But if this app works with the embedded script approach (and chances are high it does), you are stuck with the slow redirect.

So what's a better alternative?

Thought you'd never ask!

First of all, to solve the speed issue, the redirect needs to happen on the server, without the need to load any website in the visitor's browser. This eliminates a few steps that also happen to be the most 'expensive' as far as speed is concerned.

Below I discuss two great ways to on how to achieve server side redirects, based on who you are.

In case you are a developer

Look no further than Netlify redirects. Create a Netlify project with just a `netlify.toml` file full of redirect rules. Netlify redirects are really powerful and should be enough for most scenarios.

In case you are NOT a developer

Make use of the simple yet powerful redirect app fastfwd.to, built by yours truly.

7 comments

Post a comment