How to Display Visitor Location on Landing Page

This is a useful trick that many affiliates don’t use or don’t know how to use. It’s do-able with most modern affiliate tracking software. This has been proven to increase click-through rate and conversion rate when used properly.

How It’s Done

The plan is to capture the visitor’s location using the tracking platform, then pass that variable on to your landing page. This is done by asking the tracking software to forward the selected token to the landing page using extra code added to the end of the landing page URL like:{city}

In the case below, the tracking platform is BeMob but you can use most other tracking software to do the same. As you can see, the landing page URL contains the variable “?city=” at the end of it. The option “+city” is ticked in the available tokens section which tells the tracker to fill it in with the actual city of the visitor.

Next, two sets of JavaScript codes have to be added to the landing page in order to be able to display the token passed to it by the tracking platform.

First the following code must be added before the </head> tag:

function getURLParameter(name) {
var query =;
var vars = query.split(“&”);
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split(“=”);
if(pair[0] === name){return pair[1];}
return “”;

Finally, the following code must be added after the <body> tag to display the token replacing it with the value passed on by the tracker on the landing page:


Note, city can be replaced by any other token that you may choose to pass on to your landing page. Other useful tokens include OS, Country, and could even include tokens passed on by the traffic source.


I highly recommend that you play around with these tokens to see the results. Sometimes, it could make or break your campaign.

I’m currently running an adult dating campaign. I split-tested two versions of the same landing page with the city token enabled in the title and one without it.

Here is the result, the top line is the landing page with the city token included in the title area.


Leave a Reply

Notify of