Geo-targeting for html pages

4 replies
Hey warriors, I'm looking for a way to have my html page specify the state visitors are in using their ip address. In other words, I want my page to say "Welcome New Jersey Residents" if the visitor is using a New Jersey ip and "Welcome Florida Residents" if the visitors is using a Florida ip.

Any ideas???
#geotargeting #html #pages
  • Profile picture of the author Tradeout
    To do this yourself without using a service or api, you will need some geolocation data.

    You can get geolocation data for free, but this is not as accurate as paid data. All depends on if you can stand a few erroronus location names.

    Once you have this data, load it into MySQL and away you go.

    On your web pages add a few lines of php code:
    Get users IP
    Lookup IP in table
    get the location from the query lookup
    Output to screen

    if you want some help doing this let me know.
    {{ DiscussionBoard.errors[6077059].message }}
  • Profile picture of the author dagnyjbarber
    something new for me. even i was looking for the same.thanks
    Signature

    {{ DiscussionBoard.errors[6077639].message }}
  • {{ DiscussionBoard.errors[6077858].message }}
  • Profile picture of the author msu
    There's also a service using Javascript, called maxmind, I think. But unless you're using paid data I don't think you'll get the location down to the city or state.
    Signature
    New to WordPress? Save time with my beginner's guide:
    WordPress Step-by-Step
    (for Kindle & Kindle Apps)

    I'm a top-notch WordPress developer: hire me
    {{ DiscussionBoard.errors[6078093].message }}

Trending Topics