We'll create fresh WordPress site with WP Engine GeoTarget installed. You have 20 minutes to test the plugin after that site we'll be deleted.
WP Engine GeoTarget integrates with the variables on your WP Engine site to display content catered to the visitor’s location. With the ability to access variables from as broad as country to as specific as latitude and longitude, your website can now display geographically relevant content.
Customers on Premium and Enterprise plans can use this plugin at no additional cost. If you are on another plan type and would like to use GeoTarget on one of your sites, you can add it to your plan here. This will not function outside of the WP Engine environment.
You can use any of the following location variable shortcodes to return the various geographic location the user is visiting your site from:
1) Continent: [geoip-continent]
2) Country: [geoip-country]
3) Region: [geoip-region]
4) City: [geoip-city]
5) Postal Code: [geoip-postalcode]
6) Latitude: [geoip-latitude]
7) Longitude: [geoip-longitude]
8) Location: [geoip-location]
Hi, and welcome to [geoip-city]! The place to be in [geoip-region],[geoip-country].
A visitor from Austin, Texas would see the following:
Hi, and welcome to Austin! The place to be in TX, US.
[geoip-content country="US"]Your US specific content goes here[/geoip-content]
The content shortcode allows you to hide or show specific content based on visitor geographies:
Below are all the supported geography options, this allows to you SHOW content for only specific locations:
Below are all the supported negative geography options, this allows to you HIDE content for only specific locations:
This will display “Content just for US visitors” strictly for visitors viewing from the United States.
[geoip-content country="US"] Content just for US visitors [/geoip-content]
This will display “Content just for everyone in Texas and California” strictly for visitors from Texas and California.
[geoip-content region="TX, CA."] Content just for everyone in Texas and California [/geoip-content]
You can mix and match geography and negative geography options to create verbose logic in a single shortcode:
[geoip-content country="US" not_city="Austin"]Content for US visitors but not for visitors in Austin[/geoip-content]
There is a single limitation in the logic that lets you filter content for multiple geographic areas.
You can progressively limit the area that content is shown in. But once your content is hidden from an area, a subset of that area can’t be added back in.
For example,
If I limit my content to Europe, then limit my content from Great Britain, I can’t go back and show it to London.
You want to show an offer for free shipping to every state in the US but Alaska and Hawaii. You may be inclined to write something like
BAD
[geoip-content country="US" not_state="AK, HI"]Lorem ipsum dolor sit amet[/geoip-content]
Instead, show it to all other 48 states
GOOD
[geoip-content state="AL, AZ, AR, CA, CO, CT, DE, FL, GA, ID, IL, IN, IA, KS, KY, LA, ME, MD, MA, MI, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY"]Free shipping on all orders over $50![/geoip-content]
You want to show discount airfare on a flight to Paris, France. The content should show to all of the US and France, but not Paris itself.
BAD
[geoip-content country="US, FR" not_city="Paris"]Fly to Paris for only $199![/geoip-content]
The problem here is that Paris, Texas will be hidden. The solution? Just have two geoip-content shortcodes.
GOOD
[geoip-content country="FR" not_city="Paris"]Fly to Paris for only $199![/geoip-content][geoip-content country="US"]Fly to Paris for only $199![/geoip-content]
You want to show an ad written in Spanish to all of South America except for Brazil. Brasilia, however, has enough Spanish speakers that you want to include Brasilia.
BAD
[geoip-content continent="SA" not_country="BR" city="Brasilia"]Lorem ipsum dolor sit amet[/geoip-content]
GOOD
[geoip-content continent="SA" not_country="BR"]Venta de la Navidad en los adaptadores USB[/geoip-content]
[geoip-content city="Brasilia"]Venta de la Navidad en los adaptadores USB[/geoip-content]
You have a utility function that will calculate the distance from your provided lat/lng coordinate to the visitor’s location in either miles or kilometers. This can be useful for determining approximate distances, as results may be cached at the state or country level, depending on your configuration.
Example use:
$latitude = 30.268246;
$longitude = -97.745992;
$geo = WPEngine\GeoIp::instance();
if ( false !== $geo->distance_to( $latitude, $longitude ) ) {
$miles_to_wp_engine = $geo->distance_to( $latitude, $longitude );
}
You can use the following URL parameters to test how your localized content will appear to visitors from various geographic locations. You can add any of the parameters below to any URL of a page using the GeoTarget shortcodes or API calls:
Spoof visitor from the state of Texas:
yourdomain.com/?geoip®ion=TX
Spoof visitor from the United States:
yourdomain.com/?geoip&country=US
Spoof visitor from Austin, Texas
yourdomain.com/?geoip&city=Austin
Spoof visitor from the U.S. zip code 78701:
yourdomain.com/?geoip&zip=78701
Please note: full page redirects and TLD redirects still need to be implemented with the necessary API calls.