Forum Moderators: coopster

Message Too Old, No Replies

How to show different text depending on geo location

Adding a where to buy - only want to list resellers in same country

         

wfernley

6:55 pm on Nov 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey everyone,

I thought this would be possible, I just wanted some clarity on how to do it. I have a Where to Buy section on my website and I would like to create a PHP script that will limit which stores are displayed depending on the geographic location of the visitor.

How would I go about doing this?

Also, would this cause any issues with Google?

Thanks in advance for your help!

jatar_k

7:04 pm on Nov 29, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



there are geo targetting db's around, two that come up often are

[maxmind.com...]
[ip-to-country.webhosting.info...]

as far as G goes, no big deal, geo targetting is accepted practice

wfernley

7:06 pm on Nov 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for your reply!

Are those services free by chance? :)

justageek

7:10 pm on Nov 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could download the ip data from someone like maxmind and then calculate the radius around the ip for whatever distance you want. Depending on your needs you can just ballpark each latitude and longitude degree as a certain mileage or for a more acurate number use a great-circle formula. Either way it is fairly easy to do.

JAG

justageek

7:12 pm on Nov 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jatar_k beat me to it :-) Maxmind has a free version that will get you started and then you can decide if you need more info later and upgrade to the pay version of the data.

JAG

wfernley

7:22 pm on Nov 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sounds good. I will have to fool around with it then.

Ballpark should be fine. It is just listing locations they can purchase the products. I don't want to list the closest ones to them, just ones in the same country.....mainly US, Canada and UK.

justageek

7:28 pm on Nov 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't want to list the closest ones to them, just ones in the same country

You'll be just fine then :-)

JAG

wfernley

8:14 pm on Nov 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Great! Thanks :D