Forum Moderators: buckworks

Message Too Old, No Replies

banner displaying based on IP

         

mzadorian

5:30 am on Nov 30, 2010 (gmt 0)

10+ Year Member



I want to create a banner, then based on customer's IP address for example if they live in NY, then this banner loads. is this possible , anyway i can do this?

thank you

enigma1

12:20 pm on Nov 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'll need a database to check incoming IPs against. There is no code to automatically and precisely determine the geo location as the IP allocation changes.

You retrieve the IP address from the REMOTE_ADDR header the client sends and then you check it with a database that holds the geo info. And the database should include city details, so watch for it, because lots they only include country.

ssgumby

2:08 pm on Nov 30, 2010 (gmt 0)

10+ Year Member



I think the issue with this is you are going to be showing a banner based on where their server is, not where they are. For example, I am right now sitting physically in Pennsylvania, but if I check my IP it says I am in San Fransisco, CA which is where my server is.

enigma1

3:41 pm on Nov 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why would you connect via a server to the net? Typically that's not the case and there will be latencies. The closer the ISP's gateway is the better.

You display a banner based on the IP you cannot tell if there is a proxy or another medium in between.

ssgumby

3:52 pm on Nov 30, 2010 (gmt 0)

10+ Year Member



My wording was bad in my post. Im saying its based on your isp. Yes, perhaps the closer the ISP gateway is the better but you dont always have that choice. Corporate networks for example, your gateway is based on where their data center is. large national ISPs will connect you based on many factors.

Trust me, our site we use geo filtering to determine where to show our google ads. We exclude California for example. However, we get orders via google ads from California as their IP resolves to a location in Texas or some other place. Happens a LOT.