GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Geo WHAT? Geotracking? Tagging? Help here. (https://gfy.com/showthread.php?t=1093053)

srockhard 12-15-2012 10:52 PM

Geo WHAT? Geotracking? Tagging? Help here.
 
Using one ad, is it possible to clickthrough to a specific page depending on the users geo location?

For instance if someone in Alaska clicked the ad then it might show a site about shoveling snow but if someone in Hawaii clicked the ad then it would show a site about surfing.

Is this possible? What is it called and where can I get a script to do this?

shake 12-15-2012 11:14 PM

Yes, use something like maxmind geoip, and a couple lines of php code.

srockhard 12-15-2012 11:34 PM

Quote:

Originally Posted by shake (Post 19372745)
Yes, use something like maxmind geoip, and a couple lines of php code.

Since I don't know PHP is there already written anywhere that you know of? Would this pretty easy to have custom?

JamesM 12-16-2012 12:55 AM

here you go


Code:

<html>
<head>
<script src="http://j.maxmind.com/app/geoip.js" type="text/javascript"></script>
<script type="text/javascript">
    switch(geoip_country_code()){
        case "AT" :
            document.location.href = "http://austriatraffic.com";
            break;
        case "CH" :
            document.location.href = "http://switzerlandtraffic.com"
            break;
        case "DE" :
            document.location.href = "http://germantraffic.com"
            break;
        case "IN" :
        document.location.href = "http://indiatraffic.com"
            break;
        default :
            document.location.href = "http://othertraffic.com.com"
            break;
    }
</script>
</head>
</html>

in above code, you just have add specific country codes from which traffic and the target url

like this
Quote:

case "IN" :
document.location.href = "http://indiatraffic.com"
break;

hope this helps.,

srockhard 12-16-2012 03:39 AM

This looks real good...I will give it a try tomorrow. What about geo codes on the state and city level...all of which will be in the United States? Is it possible to get that specific?

JamesM 12-16-2012 06:06 AM

Quote:

Originally Posted by srockhard (Post 19372933)
This looks real good...I will give it a try tomorrow. What about geo codes on the state and city level...all of which will be in the United States? Is it possible to get that specific?

access this link

http://j.maxmind.com/app/geoip.js

you will get something like this


Code:

function geoip_country_code() { return 'DE'; }
function geoip_country_name() { return 'Germany'; }
function geoip_city() { return 'Berlin'; }
function geoip_region() { return '16'; }
function geoip_region_name() { return 'Berlin'; }
function geoip_latitude() { return '52.5167'; }
function geoip_longitude() { return '13.4000'; }
function geoip_postal_code() { return ''; }
function geoip_area_code() { return ''; }
function geoip_metro_code() { return ''; }

you can catch every variable from above list.,

like the script i posted b4 using geoip_country_code()

you can set to any of the above.

try it.,

EddyTheDog 12-16-2012 06:14 AM

Quote:

Originally Posted by JamesM (Post 19372998)
access this link

http://j.maxmind.com/app/geoip.js

you will get something like this


Code:

function geoip_country_code() { return 'DE'; }
function geoip_country_name() { return 'Germany'; }
function geoip_city() { return 'Berlin'; }
function geoip_region() { return '16'; }
function geoip_region_name() { return 'Berlin'; }
function geoip_latitude() { return '52.5167'; }
function geoip_longitude() { return '13.4000'; }
function geoip_postal_code() { return ''; }
function geoip_area_code() { return ''; }
function geoip_metro_code() { return ''; }

you can catch every variable from above list.,

like the script i posted b4 using geoip_country_code()

you can set to any of the above.

try it.,

I did not know they where doing that - I have been using the DB on my own server - I will have a look at the rate limits, I might use that instead....

Thanks

Oracle Porn 12-16-2012 10:42 AM

Quote:

Originally Posted by JamesM (Post 19372838)
here you go


Code:

<html>
<head>
<script src="http://j.maxmind.com/app/geoip.js" type="text/javascript"></script>
<script type="text/javascript">
    switch(geoip_country_code()){
        case "AT" :
            document.location.href = "http://austriatraffic.com";
            break;
        case "CH" :
            document.location.href = "http://switzerlandtraffic.com"
            break;
        case "DE" :
            document.location.href = "http://germantraffic.com"
            break;
        case "IN" :
        document.location.href = "http://indiatraffic.com"
            break;
        default :
            document.location.href = "http://othertraffic.com.com"
            break;
    }
</script>
</head>
</html>

in above code, you just have add specific country codes from which traffic and the target url

like this



hope this helps.,

is it possible to use my own maxmind geo ip (on my server) rather then use theirs?

srockhard 12-16-2012 01:01 PM

Quote:

Originally Posted by JamesM (Post 19372998)
access this link

http://j.maxmind.com/app/geoip.js

you will get something like this


Code:

function geoip_country_code() { return 'DE'; }
function geoip_country_name() { return 'Germany'; }
function geoip_city() { return 'Berlin'; }
function geoip_region() { return '16'; }
function geoip_region_name() { return 'Berlin'; }
function geoip_latitude() { return '52.5167'; }
function geoip_longitude() { return '13.4000'; }
function geoip_postal_code() { return ''; }
function geoip_area_code() { return ''; }
function geoip_metro_code() { return ''; }

you can catch every variable from above list.,

like the script i posted b4 using geoip_country_code()

you can set to any of the above.

try it.,


I really appreciate your help! Works perfectly!

JamesM 12-16-2012 03:53 PM

Quote:

Originally Posted by EddyTheDog (Post 19373001)
I did not know they where doing that - I have been using the DB on my own server - I will have a look at the rate limits, I might use that instead....

Thanks

http://dev.maxmind.com/geoip/javascript

Code:

Free use of the service is allowed, if the following link is included on your website:

This website uses <a href="http://www.maxmind.com/en/javascript">MaxMind's
GeoIP JavaScript Service</a>



Quote:

Originally Posted by Oracle Porn (Post 19373271)
is it possible to use my own maxmind geo ip (on my server) rather then use theirs?

i guess , its possible. but you have to update maxmind geo ip database file on your server , every month.

Quote:

Originally Posted by srockhard (Post 19373440)
I really appreciate your help! Works perfectly!

please take a look at

http://dev.maxmind.com/geoip/javascript

and imho , you should use something with php as this method wont work if browsers have javascript disabled.

thanks

seeandsee 12-16-2012 04:04 PM

this scripts looks good, but serving it from your own server just using their db would be even better

borked 12-16-2012 04:06 PM

or you can use geoplugin

EddyTheDog 12-16-2012 04:10 PM

Quote:

Originally Posted by borked (Post 19373727)
or you can use geoplugin

That is an awesome API as well.


All times are GMT -7. The time now is 05:18 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc