WP Geocode is a WordPress plugin which enables you to leverage geographic information about your blog readers.
If you’ve been doing business online for any length of time, you already understand the value of researching the data available about your web site viewers. Tools like Google Analytics is a great help because it shows you valuable data about the viewers of your web site. The problem is that it this data is not exactly timely. That’s where WP Geocode comes in.
WP Geocode let’s you create content customized for the individual user based on where they are when they view your site.
Imagine you want to target folks in a local shopping mall. Perhaps, they’re in a local coffee shop on a wifi connection. We’d simply need to get the latitude and longitude coordinates of the coffee shop and use those in our wordpress post.
There are two types of shortcodes implemented by wpgeocode. The first is data shortcodes. These are shortcodes which enable you to utilize geocode data in your posts or pages. For example, [wgc_city] will be replaced by the city of the current reader of your post or page. The second type of shortcode implemented by wpgeocode is a conditional shortcode. These enable you to conditionally include content if specific geocode conditions are met. For example, [wp_is_state_code state=’PA’] SOME TEXT [/wp_is_state_code] will display SOME TEXT for readers of the page or post that are currently in PA. For full details, see http://www.wpgeocode.com
[wpws url = “http://wordpress.org/extend/plugins/wpgeocode/stats/” selector=”div .col-3 p” cache=”60″ timeout=”3″ error=”cache”]
Use these shortcodes to incorporate reader geolocation data into your blog posts
[wpgc_ip] – IP Address of the reader
[wpgc_city] – City of the reader
[wpgc_state_name] – State name of the reader
[wpgc_state_code] – Two letter State code of the reader
[wpgc_postal_code] – Five digit Postal code of the reader (eg: ~)
[wpgc_country_name] – Country name of the reader
[wpgc_country_code] – Two letter Country code of the reader
[wpgc_latitude] – Latitude of the reader
[wpgc_longitude] – Latitude of the reader
Conditional Shortcodes – Only available in the body of the post
Use these shortcodes to display customized content in your blog posts to readers
[wpgc_is_city_and_state city=”Yardley” state_code=”PA”]
[wpgc_is_nearby”] – Uses the value you specify in the Nearby Range setting from the administrative panel
[wpgc_is_nearby] Hi Neighbor! [/wpgc_is_nearby] – Will display “Hi Neighbor!” to readers within a configurable distance from your home base.
[wpgc_is_within miles=10] Stop on over, since you’re in the area.[/wpgc_is_within] – Will display “Come on over!” in the post body if the user is viewing the post from within 10 miles.
[wpgc_is_ip ip=126.96.36.199] I used to own this IP Address [/wpgc_is_ip] – Will display the message only if the user has that specific IP Address.
[wpgc_is_city city=”Yardley”] Hello Fellow Yardlian [/wpgc_is_city] – Will display the message only if the user has that specific IP Address.
There are several pages on this blog that incorporate examples of WPGeocode: