Setting Up Geotargeting

The Geotargeting extension allows you to target popups to specific countries or postal codes. If you haven't already, refer to the extension installation documentation to install and activate your extension.

Installation and Setup

Once the extension is activated, there will be a new settings tab within the "Settings". To get there, log into your WordPress admin. Then:

  1. Go to the "Settings" page in the "Popup Maker" menu
  2. Switch to the "Extensions" tab
  3. Switch to the "Geo Targeting" tab

Once on the "Geo Targeting" tab, you see will an option for providers. At this time, the extension works with:

  1. IPStack
  2. WP Engine's GeoTarget Add-on
  3. CloudFlare IP Geolocation 

Setting Up Using IPStack

IPStack is a geolocating service for IP Addresses which updates their data up to 20 times per day. Even better, they have a free plan! However, the free plan does not use SSL, so you may want to upgrade to the paid plan after testing.

To get started,

  1. Go to their pricing page
  2. Select sign up on the tier that works best for your site
  3. Once signed up, copy your API Key

Now, come back to the "Geo Targeting" settings for this extension. Paste your API Key into the "IP Stack API Key" setting. 

If you are using a premium IP Stack plan, check the "IP Stack Pro Account" option in order to use the https version of the API.

Once you are finished, be sure to click the "Save" button.

Setting Up Using WP Engine

If your site is hosted on WP Engine and you have the GeoTarget add-on, a new "WP Engine" option will appear in the "Geo Targeting Provider" drop-down. Select that option and then click the "Save" button. You are ready to go!

* Please note: WP Engine only contains the country and region targeting conditions. The postal code targeting condition will not appear when using the WP Engine targeting provider.

Setting Up Using CloudFlare

If your site is using CloudFlare and you enable their IP Geolocation feature, a new "CloudFlare" option will appear in the "Geo Targeting Provider" drop-down. Select that option and then click the "Save" button. You are ready to go!

* Please note: CloudFlare only contains the country targeting conditions. The postal code and region code targeting conditions will not appear when using the CloudFlare targeting provider.

Using Geotargeting Conditions

Once your settings are set up, you can now use new conditions when editing your popups. To use one, first, edit the popup. Now, go to the "Targeting" tab of the "Popup Settings". If you add or edit a condition, you will find two new conditions:

  1. Country Code Is
  2. Region Code Is
  3. Postal Code Is

Targeting Countries

To target your popops to certain countries (or to exclude certain countries), you will use the "Country Code Is" condition. Within the country code condition, you can enter the country codes for each country you want to target. We use the 2-letter country code system, which you can find a full list of on this Wikipedia page. If targeting more than one country, you can use commas to separate them, as shown in the image below.

If you want to target all countries but exclude a few countries, you can click the "!" symbol to switch to the opposite mode for the condition. That means, show the popup to all countries except those listed.

Be sure to save your popup once finished.

Targeting States Or Provinces

To target your popops to certain states or provinces (or to exclude certain states or provinces), you will use the "Region Code Is" condition. Within the region code condition, you can enter the region codes for each state or province you want to target. If targeting more than one, you can use commas to separate them, as shown in the image below.

If you want to target all region codes but exclude a few of them, you can click the "!" symbol to switch to the opposite mode for the condition. That means, show the popup to all visitors except those in region codes listed.

Be sure to save your popup once finished.

Targeting Postal Codes

To target your popops to certain postal codes (or to exclude certain postal codes), you will use the "Postal Code Is" condition. Within the postal code condition, you can enter the postal codes for each postal code you want to target. 

This condition can also accept a range of zip codes. For example, 32606-32608 would target 32606, 32607, and 32608. 

Since many zip codes can be small and houses can be right on the border making it difficult for geolocation to get the right zip code, it is advisable to target a group of zip codes unless you specifically need to only show to an exact zip code. For example, if you were targeting zip codes of Brooklyn, New York, you might do 11201-11256 to cover Brooklyn but also include 11101 and 11379 which are just past it.

If targeting more than one postal code (or range of postal codes), you can use commas to separate them, as shown in the image below.

If you want to target all postal codes but exclude a few of them, you can click the "!" symbol to switch to the opposite mode for the condition. That means, show the popup to all visitors except those in postal codes listed.

Be sure to save your popup once finished.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.