Geo-Targeting
The Get-Targeting shortcode for WordPress can be used to target content to users in specific countries. You can display different content to visitors based on their location. For this shortcode to work, your website needs to be served through Cloudflare. Check below for example implementations and shortcode documentation:
Geo-Targeting Examples
Geo-Targeting Shortcodes
[x3m-geotarget include-country="US"] this content is visible only in the US [/x3m-geotarget]
[x3m-geotarget exclude-country="US"] this content is visible outside the US [/x3m-geotarget]Geo-Targeting Documentation
First, the most important requirement for this shortcode to work is for your website to be served through Cloudflare (free plan works). Cloudflare offers a geo-location data which is used by our shortcode to display the appropriate content to specific countries. By default this service is activated in Cloudflare, but in case your website does not display the correct content to specific countries, check for the Cloudflare’s CF-IP Country header to be active (enable the “Add visitor location headers” Managed Transform in your Cloudflare dashboard).
Here are the shortcode option settings available for Geo-Targeting:
| Shortcode Settings | Details |
|---|---|
| include-country=”US” or exclude-country=”US” |
used to include or exclude the country to display the content to. Multiple countries can be included in this list, listing them comma separated (ex: “US, JP, FR”). The countries listed should use the 2 letter/alpha-2 notation |