Below is a free geo redirect script that I found online and tried to modify for my own purposes (it had only 2 destinations, and I've added more). However, I know NOTHING about programming. It seems to be working for US and Canada, but I don't see evidence of UK traffic being properly redirected.
Redirect script -- does this look right?
1
Below is a free geo redirect script that I found online and tried to modify for my own purposes (it had only 2 destinations, and I've added more).
However, I know NOTHING about programming. It seems to be working for US and Canada, but I don't see evidence of UK traffic being properly redirected.
I'm using this for promoting CPA offers, though below I've changed the destinations to Google addresses
Any suggestions would be greatly appreciated! Perhaps this will be instructive for others as well.
-------------------------
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<script language="JavaScript">
var country= geoip_country_code();
if(country == "US")
{
<!--
window.location = "google.com"
//-->
}
if(country == "GB")
{
<!--
window.location = "google.com.uk"
//-->
}
if(country == "CA")
{
<!--
window.location = "google.ca"
//-->
}
else
{
<!--
window.location = "http://www.google.com"
//-->
}
</script>
However, I know NOTHING about programming. It seems to be working for US and Canada, but I don't see evidence of UK traffic being properly redirected.
I'm using this for promoting CPA offers, though below I've changed the destinations to Google addresses
Any suggestions would be greatly appreciated! Perhaps this will be instructive for others as well.
-------------------------
<script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
<script language="JavaScript">
var country= geoip_country_code();
if(country == "US")
{
<!--
window.location = "google.com"
//-->
}
if(country == "GB")
{
<!--
window.location = "google.com.uk"
//-->
}
if(country == "CA")
{
<!--
window.location = "google.ca"
//-->
}
else
{
<!--
window.location = "http://www.google.com"
//-->
}
</script>
- l3vi501
Next Topics on Trending Feed
-
1