Home > Questions and Answers > General Questions

Is it possible to change links for ip addresses through geo targeting? (4)


09-19-2012 08:31 PM #1 fauxrillz (Member)
Is it possible to change links for ip addresses through geo targeting?

Exactly what the title says. Wondering if it's possible to switch up to an offer for the UK for a UK visitor or Canadian to a Canadian offer?

Any help would be awesome. Thanks!


09-20-2012 08:12 AM #2 hd2010 (Member)

you need a script to redirect the user based on their ip, let say a user from US, in your script, the ip will be identify from which country, then redirect to the url you have already specified


09-20-2012 09:14 AM #3 jonemd (Member)

Quote Originally Posted by fauxrillz View Post
Exactly what the title says. Wondering if it's possible to switch up to an offer for the UK for a UK visitor or Canadian to a Canadian offer?

Any help would be awesome. Thanks!
Rockstar john posted the following here

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>TITLE HERE</title>

</head>
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<script language="JavaScript">
var country = geoip_country_code();
switch (country)
{
case (country = "US"):
window.location = "YOURLINKHERE";
break;

case (country = "CA"):
window.location = "YOURLINKHERE";
break;

case (country = "AU"):
window.location = "YOURLINKHERE";
break;

case (country = "GB"):
window.location = "YOURLINKHERE";
break;

default:
window.location = "YOURLINKHERE";
break;
}
</script>
<body>
</body>
</html>
Looks like that will do what you want.


09-20-2012 11:57 AM #4 zeno (Administrator)

Quote Originally Posted by fauxrillz View Post
Exactly what the title says. Wondering if it's possible to switch up to an offer for the UK for a UK visitor or Canadian to a Canadian offer?

Any help would be awesome. Thanks!
That's basically what GeoIP stuff is for ;D

If you're doing so inside a lander and want to show different pages then the script above is for that. However, if you're wanting people to click a link and then arrive at a different destination based on geographic location you will want to use PHP to do so. Also, be aware the use of MaxMinds javascript means it is going to contact their server every time someone visits your page. If something happens on their end you will lose the functionality, and if you run volume they are likely to probably blacklist you = script wont work any more. In the long run it's better to figure out how to use GeoIP functions on your own server.


Home > Questions and Answers > General Questions